change: for (i = 0; i <= myform.Impact.length; i++)
to: for (i = 0; i < myform.Impact.length; i++)


On Wed, 16 Feb 2005 11:13:32 -0800, John Wilker <[EMAIL PROTECTED]> wrote:
> I didn't know of a good JS list
> 
> I have the code below. The if loop seems to kill the script. The IF
> loop runs fine but the alert after the FOR and everything after the
> FOR for that matter, fail to execute.
> 
> function Validator() {
>                 var myform = document.getElementById('SuggestionForm');
>                 var errMsg = ''
>                 var checkboxcounter = 0
>                 if (myform.SuggestionText.value == '')
>                         errMsg = errMsg + '- Please explain your 
> suggestion.\n\r'
>                 if (myform.SuggestTitle.value == '')
>                         errMsg = errMsg + '- Your suggestion needs a 
> title.\n\r'
>                 alert(myform.Impact.length);
>                 for (i = 0; i <= myform.Impact.length; i++)
>                 {
>                         if (myform.Impact[i].checked) {
>                                 alert('true');
>                                 checkboxcounter++;
>                         }else{
>                                 alert('false');
>                         }
>                 }
>                 alert('hi');
>                 alert(checkboxcounter);
>                 if (errMsg != '')
>                         alert(errMsg)
>                 else
>                         myform.submit()
>         }
> 
> Any thoughts.
> 
> --
> John Wilker
> Writer/Web Consultant
> www.red-omega.com
> 
> "I balance, I weave, I dodge, I frolic, and my bills are all paid. On
> weekends, to let off steam, I participate in full-contact origami."
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195057
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to