[thelist] Javascript validation help....HELP!!

Matt Warden mwarden at gmail.com
Thu Aug 17 10:38:23 CDT 2006


On 8/17/06, Michael Pack <michaelpack at wvdhhr.org> wrote:
> (c) something else
>
> I want an alert when the user has checked the Yes radio button, which
> has a value of "Yes", but has not checked 1 or more of the checkboxes.
>
> Thanks MW

Something like:


function get_Children_value()
{
for (var i=0; i < document.sfcp_inquiry.Children.length; i++)
  {
  if (document.sfcp_inquiry.Children[i].checked)
     {
     return document.sfcp_inquiry.Children[i].value;
     }
  }
}

function ageIsChecked() {
    var ischecked = false;
    for (var i=0; i<document.theForm.AgeInterest.length; i++) {
        if (document.theForm.AgeInterest[i].checked) {
            ischecked = true;
            break;
        }
    }
    return ischecked;
}


var Children_val = get_Children_value();
if (Children_val == "Yes" && !ageIsChecked()) {
    alert('...');
}




-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list