Is there an array tester in JS?

Results 1 to 2 of 2

Thread: Is there an array tester in JS?

  1. #1
    Join Date
    Dec 1969

    Default Is there an array tester in JS?

    Are there any kind souls that wouldnt mind looking at this and telling me why it only works if there is more than one checkbox?<BR><BR><BR>function validateEMAIL()<BR>{<BR>var TheBoxes = document.form1.chkApplicant;<BR>var blnInvalid = false;<BR>var NumChecked = 0;<BR>for (var i = 0; i &#060; TheBoxes.length; i++)<BR>{<BR>if (TheBoxes.length &#062; 1)<BR> curOption = TheBoxes[i];<BR>else<BR> curOption = TheBoxes;<BR>curValue = curOption.value;<BR>curIsChecked = curOption.checked;<BR>if (curIsChecked == true)<BR>{ <BR> NumChecked = NumChecked +1;<BR> if (curValue.indexOf("$N$") &#062; 0)<BR> {<BR> blnInvalid = true;<BR> alert("You cannot Email applicants
    that you have already emailed");<BR> curOption.focus();<BR> break;<BR> }<BR>} <BR>}<BR>if (NumChecked == 0)<BR>{<BR>alert("You need to select applicants to Email");<BR>if (TheBoxes.length &#062; 1)<BR> TheBoxes[0].focus();<BR>else<BR> TheBoxes.focus();<BR>}<BR>else if (blnInvalid != true)<BR>{<BR> document.form1.hdnMode.value = 4;<BR> document.form1.submit();<BR>}<BR><BR>

  2. #2
    jason Guest

    Default RE: Is there an array tester in JS?

    using &#039&gt;1&#039 is the same as saying &#039 2 or more&#039<BR><BR>use &gt;0 or &gt;=1<BR><BR>jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts