garfield11
IS-IT--Management
Hi all,
Below r javaScript codes to check all/clear all checkboxes:
<SCRIPT LANGUAGE = "JavaScript">
<!--
function SetChecked(val, chkboxname) {
dml=document.forms[0];
len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if (dml.elements.name == chkboxname)
dml.elements.checked = val;
}
}
//-->
</script>
<a href="javascript:SetChecked(1, 'Employee_ID')">Check All</a> - <a href="javascript:SetChecked(0, 'Employee_ID')">Clear All</a>
<input type="submit" name="Submit" value="Next ->">
Now i want my program to work like if none of the checkboxes are check, don't submit the form (that's when i click the "Next" button, no action perform).
Can anyone please kindly advise.
Thanks!
Love_Garfield
Below r javaScript codes to check all/clear all checkboxes:
<SCRIPT LANGUAGE = "JavaScript">
<!--
function SetChecked(val, chkboxname) {
dml=document.forms[0];
len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if (dml.elements.name == chkboxname)
dml.elements.checked = val;
}
}
//-->
</script>
<a href="javascript:SetChecked(1, 'Employee_ID')">Check All</a> - <a href="javascript:SetChecked(0, 'Employee_ID')">Clear All</a>
<input type="submit" name="Submit" value="Next ->">
Now i want my program to work like if none of the checkboxes are check, don't submit the form (that's when i click the "Next" button, no action perform).
Can anyone please kindly advise.
Thanks!
Love_Garfield