[Javascript] radio button form validation issue

Falls, Travis D (CASD, IT) Travis.Falls at thehartford.com
Fri Apr 25 14:24:19 CDT 2003


Here is my script, the mySurvey[i] is evaluating to undefined, but if I
reference the actual name of the radio button I get the proper amount.  any
ideas?
 
 
<script language="JavaScript" type="text/javascript">
    function validateForm(mySurvey){
         for(i=0; i<mySurvey.length; i++){
  
              if(mySurvey[i].type=="radio"){ 
                   var isSelected=false;
   
                   for(u=0; u < mySurvey[i].length; u++){
                        if(mySurvey[i][u].checked){
                             alert("correct");
                             isSelected=true;
                             return true; 
                        }//ends if
                        else{
                             alert("inCSorrect");
                        } 
                   }//ends for u 
               }//ends if radio 
         } //ends for i 
     return false;
    }//ends function
</script>
 
__________________________________________________________

Travis D. Falls
software engineer

HTSC/CASD/IT
 <mailto:travis.falls at thehartford.com> travis.falls at thehartford.com 
phone: 860.547.4070
fax: 860.723.4463
__________________________________________________________ 
 


This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20030425/96a7339d/attachment.htm>


More information about the Javascript mailing list