You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Susmita Pati <SP...@alsysinc.com> on 2002/08/21 23:26:00 UTC
Problems with Checkbox
Hi All
i am doing this check to see if any check boxes have been selected or not
before the user hits on the submit button.
It works fine if there are more then 1 row displayed on my page..If no
selections have been made then the alert box comes up with "Please make a
selections."
But if theres only one row displayed this fails..
Any suggestion where am going wrong???
function checker() {
var choices = 0;
var type = confirm("Are you sure you want to preview the Carton Details?");
if (type) {
for (counter = 0; counter < cartonquery.cartonselect.length;
counter++){
if (cartonquery.cartonselect[counter].checked){
choices = choices + 1; }
}
if (radio_choices < 1 ) {
alert("Please make a selections. \n")
return (false);
}
alert("am after if");
}
else {
return false;
}
return (true);
}
thanks in advance
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>