Total members 11895 |It is currently Tue Dec 03, 2024 6:38 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Get values of Form parameters using JQuery, Get Input fields content
php code
<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>


To POST parameters using JQuery Please read this :
jquery-examples/post-parameters-using-jquery-t10686.html



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Get values of Form parameters using JQuery
 Post parameters using JQuery     -  
 get url, title and url sent parameters with JQuery     -  
 get HTML elements attributes values using JQuery     -  
 Clear specific form fields using JQuery     -  
 php login form (sign-in form)     -  
 Reference Parameters     -  
 modulus of two values     -  
 Encoding parameters in URL     -  
 Calculate the sum of values in an array     -  
 Use Alpha values to draw     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
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