progman1010
Programmer
i have a script in which a button's onclick action submits a form: document.formname.submit(); but I also need to add an onsubmit='' action to the form itself. however, the button seems to supercede the form event and i can't get it to work. any ideas?
Specifically, the page is skipping the validate() function, which works fine when i click on an actual submit button (type=submit), but not through the code as shown above.
Code:
function progress_submit(id,formie) {
document.getElementById(id).innerHTML='<img src=\'/images/ani_progress2.gif\' style=\'margin-left: 10px;\'>'
document.getElementById(formie).submit();
}
<form action="<?=$action?>" method="post" name="formie" id='formie' onSubmit="return validate();">
<p style="float:left;" id="progress1">
<input type="button" class="button" value="Next >" onclick="progress_submit('progress1','formie');"/>
</p>
</form>
Specifically, the page is skipping the validate() function, which works fine when i click on an actual submit button (type=submit), but not through the code as shown above.