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

Matt Warden mwarden at gmail.com
Thu Aug 17 10:14:30 CDT 2006


On 8/17/06, Michael Pack <michaelpack at wvdhhr.org> wrote:
> function get_Children_value()
> {
> for (var i=0; i < document.sfcp_inquiry.Children.length; i++)
>   {
>   if (document.sfcp_inquiry.Children[i].checked)
>      {
>      var Children_val = document.sfcp_inquiry.Children[i].value;
>      }
>   }
> }

Children_val is a local variable, scoped only within your if
conditional. Declare it outside the block. Also, you have some logic
issues, but I can't fix them because I'm not sure exactly what you're
trying to do.

You want an alert when:
(a) any of the checkboxes is yes and no age group is checked?
(b) a checkbox and its matching age group is not checked?
(c) something else?

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


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list