Multiple actions of a form
I want a form that looks to have which, when completed and submit button pressed, performs two actions. I mean i need some java functions that it should actually submits to both actions when i click on submit.I have had trouble finding a proper method to do this so i am here. Could you guys make me know how can i do this ? Please help me guys.
Re: Multiple actions of a form
You could write a function that fires off on the onSubmit event of
the form. I have one script but i have not tested it. Well better you try and let me know. i hope it will definitely work for this:-
Quote:
function mySubmit() {
if (data_validates) {
runAutoResponder();
}
else {
return false;
}
}
Or this :
Quote:
function doMyStuff()
{
document.myForm.submit()
document.myForm2.submit()
}
Re: Multiple actions of a form
capture the checkbox value and turn your psuedo code into a real logic statement.Try setting your buttons like...
Quote:
<input type="submit" name="action" value="Edit">
<input type="button" name="action" value="Delete">
Or try this script:
Quote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
function doubleSubmit(f)
{
f.submit();
f.target="_blank";
f.action="formmail2.php";
f.submit();
return false;
}
</script>
</head>
<body>
<form method="post" action="formmail.php" onsubmit="doubleSubmit(this)">
<input type="text" name="myTextBox"><br>
<textarea name="myTextArea"></textarea>
<input type="submit" value="Double Submit">
</body>
</html>
Quote:
<form action="query.html">
<input type="hidden" name="qp" value="url:www.techarena.in">
<input type="hidden" name="qp" value="url:www.techarena.in">
<input type="text" size="15" maxlength="35" name="qt">
<input type="submit" value="Search">
</form>
Re: Multiple actions of a form
Thanks a lot friends. That is all what i wanted. Hope this will work for me.
I appreciate your help. Thank You !!!