CheckBox (check box) value
<Scriptsrc= "Http://code.jquery.com/jquery-1.11.1.min.js"></Script><Scripttype= "Text/javascript">$(function(){ $("#form"). Submit (function(){//form submission: check box value varobj=$('input:checkbox[name= "AAA"]:checked'); Alert ("Length:"+obj.length); Obj.each (function(){ vars=$( This). Val (); alert (s); }); return false; });});</Script><formMethod= "POST"Action=""ID= "form"> <inputtype= "checkbox"name= "AAA"value= "1"checked> <inputtype= "checkbox"name= "AAA"value= "2"> <inputtype= "checkbox"name= "AAA"value= "3"> <inputtype= "Submit"></form>
Radio (radio box) value
<Scriptsrc= "Http://code.jquery.com/jquery-1.11.1.min.js"></Script><Scripttype= "Text/javascript">$(function(){ $("#form"). Submit (function(){//form submission: Radio box value varAAA=$('input:radio[name= "AAA"]:checked'). Val (); Alert (AAA); return false; });});</Script><formMethod= "POST"Action=""ID= "form"> <inputtype= "Radio"name= "AAA"value= "1"checked> <inputtype= "Radio"name= "AAA"value= "2"> <inputtype= "Radio"name= "AAA"value= "3"> <inputtype= "Submit"></form>
Select All
<Scriptsrc= "Http://code.jquery.com/jquery-1.11.1.min.js"></Script><Scripttype= "Text/javascript">$(function(){ $("#check_all"). Click (function(){ vara=$( This)[0].checked; //alert (typeof a); varInputs=document.getElementsByTagName ("input"); for(varI=0; I<inputs.length; I++){ if(Inputs[i].type== "checkbox") {inputs[i].checked=A; } } });});</Script><inputtype= "checkbox"name=""ID= "Check_all">Select All<HR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR><inputtype= "checkbox"name=""><BR>
!!! Common JS: Form code