Mon Jan 07, 2013 8:54 pm
<html>
<head>
<title>Get values of Form parameters using JQuery</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<style type="text/css">
body
{
background:#FF66FF;
font-size:11px;
}
</style>
<script>
$(document).ready(function(){
$("input#sbtButton").click(function(){
$('div#div1').html("You have entered the following values:");
$('div#div1').append( "<br/>"+$('[name=username]').val());
$('div#div1').append( "<br/>"+$('[name=password]').val());
$('div#div1').append( "<br/>"+$('[name=password2]').val());
$('div#div1').append( "<br/>"+$('[name=email]').val());
});
});
</script>
</head>
<body>
<form action="#" method="post">
<b>Username:</b><input type="text" name="username" size="50" /><br/>
<b>Password:</b><input type="password" size="50" name="password" /><br/>
<b>Confirm Password:</b><input type="password" size="50" name="password2" /><br/>
<b>Email:</b><input type="email" size="100" name="email" /><br/>
<b>Gender:</b>
<select name="gender">
<option></option>
<option>Male</option>
<option>Female</option>
</select>
<input type="submit" value="submit" id="sbtButton" />
</form>
<div id="div1"></div>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.