javascript - Dynamic script for submitting a form -


how can write dynamically use on number of forms?

function submitform() {     if(document.hotelfrm.onsubmit &&     !document.hotelfrm.onsubmit())     {         return;     }  document.hotelfrm.submit(); }  form name="hotelfrm" id="hotelfrm" method="post" action="page1.asp" 

have @ document.forms.

you might want tryout this:

function submitforms() {     for(var = 0; < document.forms.length; i++) {         if(document.forms[i].onsubmit && !document.forms[i].obsubmit()) {             return;         }          document.forms[i].submit();     } } 

please note didn't check code validity , reasonableness.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -