diarratech
Technical User
"list" is a check box on a form.
This script is supposed to check if a user selected a check box or not before deletion. It works great except when there is only one check box left. Javascript sees the value of the check box as "undefined."
(I used that script to delete rows on a form)
THANKS
function confirmSubmit()
{
var total = 0;
var maxi = frmDeletion.list.length;
{
alert("Number of checkboxes = " + " " + maxi);
}
for (var idx = 0; idx < maxi; idx++)
{
if (eval("frmDeletion.list[" + idx + "].checked"
== true)
{
total += 1;
}
}
if (total > 0)
{
alert("Total checkboxes checked =" + " " + total);
var agree=confirm("Do you want to delete " + total + " row(s) ?"
;
if (agree)
{
return true ;
}
else
{
return false ;
}
}
else
{
alert ("Checkbox not checked"
;
return false;
}
}
This script is supposed to check if a user selected a check box or not before deletion. It works great except when there is only one check box left. Javascript sees the value of the check box as "undefined."
(I used that script to delete rows on a form)
THANKS
function confirmSubmit()
{
var total = 0;
var maxi = frmDeletion.list.length;
{
alert("Number of checkboxes = " + " " + maxi);
}
for (var idx = 0; idx < maxi; idx++)
{
if (eval("frmDeletion.list[" + idx + "].checked"
{
total += 1;
}
}
if (total > 0)
{
alert("Total checkboxes checked =" + " " + total);
var agree=confirm("Do you want to delete " + total + " row(s) ?"
if (agree)
{
return true ;
}
else
{
return false ;
}
}
else
{
alert ("Checkbox not checked"
return false;
}
}