Hi,
As a beginner in Java script, I try to validate check box on the form, so users will be able to delete or add checked record when they click on delete or add buttons.So far what I have is:
function Add_record(iID) {
if (confirmActAdd(iID) == true) {
document.location.href=”taforstu_changes.asp?strAdd=1&strOperation=add&ID=” +escape(iID);
}
else {
return false;
}
}
function Delete_record(iID) {
if (confirmActDel(iID) == true) {
document.location.href=”taforstu_changes.asp?strDelete=1&strOperation=delete&ID=” +escape(iID);
}
else {
return false;
}
}
function confirmActAdd (accomID){
if (confirm(“Are you sure you want to Add Selected Accommodation(s) ” + “?”) == 1) {
alert(“Click OK to proceed with Add.”);
return true;
}
else {
alert(“Skipping Addition of Accommodation.”);
return false;
}
}
function confirmActDel (iID){
if (confirm(“Are you sure you want to Delete Selected Accommodation(s) ” + “?”) == 1) {
alert(“Click OK to proceed with Delete.”);
return true;
}
else {
alert(“Skipping Deletion of Accommodation.”);
return false;
}
}
I now want to validate if any check boxes were selected and put a prompt to make selection. In order to do it I probably should go throught a loop..???
Any help would be appreciated!