0
A little java help
New Here
,
/t5/coldfusion-discussions/a-little-java-help/td-p/925390
Jun 19, 2008
Jun 19, 2008
Copy link to clipboard
Copied
I have a form where I dynamically generate ten checkboxes.
If the seventh box is checked, then I need to make one of the input fields required.
I have something like this (lots of variations) but it will not work :
if (formname.checkbox_id["7"].checked && formname.comments.value == "")
{
alert ("Comments are required.");
formname.comments.focus();
returnStatus(false);
}
How do I do this ? thanks
If the seventh box is checked, then I need to make one of the input fields required.
I have something like this (lots of variations) but it will not work :
if (formname.checkbox_id["7"].checked && formname.comments.value == "")
{
alert ("Comments are required.");
formname.comments.focus();
returnStatus(false);
}
How do I do this ? thanks
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/coldfusion-discussions/a-little-java-help/m-p/925391#M85021
Jun 21, 2008
Jun 21, 2008
Copy link to clipboard
Copied
I think it is better to put focus on the comments field
anyway. In the following example, I have assumed that your
intention is to make the form submittable in every case, except
where checkbox 7 is checked
and the comments field is empty.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

