[Javascript] what if I don't name the form

Esther_Strom at hmco.com Esther_Strom at hmco.com
Thu Aug 1 15:52:03 CDT 2002


If you don't want to name the form, and you have only one form on the
document (or you know which form this is), you can do this:



document.forms[0].submit();


(If there's more than one form on your page, and the one to submit isn't
the first one, replace the [0] with whatever number form it is - the 2nd
one would be [1], etc.)





                                                                                                                                        
                      "doug nash"                                                                                                       
                      <quietgraceinla at h         To:      <javascript at LaTech.edu>                                                        
                      otmail.com>               cc:                                                                                     
                      Sent by:                  Subject: [Javascript] what if I don't name the form                                     
                      javascript-admin@                                                                                                 
                      LaTech.edu                                                                                                        
                                                                                                                                        
                                                                                                                                        
                      08/01/2002 04:24                                                                                                  
                      PM                                                                                                                
                      Please respond to                                                                                                 
                      javascript                                                                                                        
                                                                                                                                        
                                                                                                                                        




<FORM METHOD=POST ACTION="question02.asp">


how can I use this here


or should I just name it


this function request me to use


 <FORM METHOD=POST name="myform" ACTION="question02.asp">


<the code>


<script language = "Javascript">


function submit_it(thepage)


{


document.myform.action = thepage;


document.myform.submit();


return true;


}


</script>











More information about the Javascript mailing list