Get all form values through jquery, which is generally processed in the background language. This is obtained through jquery. It is a good idea that IE does not support it for the moment.
CSS:
The Code is as follows:
JS:
The Code is as follows:
Function form (){
$ ('# Myform'). submit (function (){
// Get text value
Var TV = $ ("# mytxt"). val (),
Tf = $ (this). find (": input [type = 'text']"). val (),
Tn = $ (this). find (": input [name = 'txtname']"). val ();
$ ("# Result1"). text (TV );
/* $ ("# Result1"). append ("You can get the value of text use these methods below:
"
+""+ TV +""+"
"
+"
"+ '$ (" # Mytxt "). val ()' +"
"
+ '$ (This). find (": input [type = \ 'text \']"). val () '+"
"
+ '$ (This). find (": input [name = \ 'txtname \']"). val () '+"
"
+"
");
*/
// $ ("# Result1"). delay (30000). fadeOut ();
// TV. attr (value, ''); clean value
// Get textarea value
Var av = $ ("# myarea"). val ();
$ ("# Result2"). text (av );
/* $ ("# Result2"). append ("You can get the value of textarea use these methods below:
"
+"
"+ Av +""+"
"
+'
$ ("# Myarea"). val ()'
+"
");
*/
// $ ("# Result2"). delay (30000). fadeOut ();
Var str = "";
/* $ ("Select"). change (function (){
$ ("Select option: selected"). each (function (){
Str + = $ (this). val ();
});
$ ("# Result3"). text (str );
})
. Trigger ('change ');
*/
// $ ("Select [name = 'garden '] option: selected") if we have multiple select
$ ("Select [id = 'mysel '] option: selected"). each (function (){
Str = $ (this). val ();
});
$ ("# Result3"). text (str );
Var str2 = "";
$ ("Select [id = 'selecel'] option: selected"). each (function (){
Str2 + = $ (this). val () + "";
});
$ ("# Result4"). text (str2 );
Var str3 = [];
$ ("Input [name = 'checkme']: checked"). each (function (){
Str3.push ($ (this). val ());
});
Var oa = "";
$. Each (str3, function (key, val ){
Oa + = key + ":" + val;
});
$ ("# Result5"). text (oa );
Var ck = $ ("input [type = 'Radio ']: checked"). val ();
$ ("# Result6" 2.16.html (ck + "is checked! ");
Return false;
});
}
Form ();
HTML:
The Code is as follows: