How to get data through form controll using javascript
function validateForm(){
var nm = document.forms["myForm"]["fname"].value;
var eml = document.forms["myForm"]["eml"].value;
var mob = document.forms["myForm"]["mob"].value;
var gen = document.forms["myForm"]["gen"].value;
var course = document.forms["myForm"]["chk"].value;
var country = document.forms["myForm"]["country"].value;
var city = document.forms["myForm"]["city"].value;
var addr = document.forms["myForm"]["address"].value;
/*-------[myultiple checkbox]----------------*/
var checkBoxes = document.getElementsByTagName('input');
// alert(checkBoxes.length);
var param = "Values of Checkboxes:"+"\n";
for (var i=0;i< checkBoxes.length;i++) {
if (checkBoxes[i].checked == true) {
param += checkBoxes[i].value + "\n";
}
}
alert(param);
}
Output
agyanadda
Author & Editor
Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.
0 $type={blogger}:
Post a Comment