TechArena Community

TechArena Community (
-   Software Development (
-   -   Multiple actions of a form (

Sadiee 29-06-2009 07:06 PM

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.

MindSpace 29-06-2009 07:11 PM

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:-


function mySubmit() {
if (data_validates) {
else {
return false;
Or this :


function doMyStuff()

opaper 29-06-2009 07:13 PM

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...


<input type="submit" name="action" value="Edit">
<input type="button" name="action" value="Delete">
Or try this script:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<script type="text/javascript">
function doubleSubmit(f)

return false;

<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">

<form action="query.html">
<input type="hidden" name="qp" value="">
<input type="hidden" name="qp" value="">
<input type="text" size="15" maxlength="35" name="qt">
<input type="submit" value="Search">

Sadiee 29-06-2009 07:14 PM

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 !!!

All times are GMT +5.5. The time now is 09:50 PM.