libsfan01 said:
Hi all
is it possible to onclick of a button in one form submit that form and
also submit another form on the same page, both with the same 'action'
location? or is it only possible to send one at a time?
kind regards
Marc
<button onClick="submitForms()">submit</button>
function submitForms() {
document.form1.submit();
document.form2.submit();
}
only problem I personally have with this method is this, in <form> tag
onSubmit="return submitForm(this)"
gets ignored.. you can also do 'submit' button with an image, thus:
<input type="image" src="send.jpg" border=0
onMouseOver="this.src='send_roll.jpg'" onMouseOut="this.src='send.jpg'">
this works because when you do "input type=image" it defaults to
'submit' type... (and as you can see you can also do a rollover for
it..) I have not found a way to do it like this for 'reset' button, so
for 'reset' button I do
<img src="reset.jpg" onClick="resetForms()" border=0
onMouseOver="this.src='reset_roll.jpg'" onMouseOut="this.src='reset.jpg'">
reset function:
function resetForms() {
document.form1.reset();
document.form2.reset();
}
I wonder if anybody here can tell me how to do this with a <button> so
call to validation function in <form> tag isn't ignored?