Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 29-06-2009
Member
 
Join Date: Jun 2009
Posts: 704
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.
Reply With Quote
  #2  
Old 29-06-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
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()
}
Reply With Quote
  #3  
Old 29-06-2009
Member
 
Join Date: May 2008
Posts: 2,383
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>
Reply With Quote
  #4  
Old 29-06-2009
Member
 
Join Date: Jun 2009
Posts: 704
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 !!!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Multiple actions of a form"
Thread Thread Starter Forum Replies Last Post
How to access form objects of multiple forms in JavaScript? N I C K Software Development 4 07-02-2010 05:42 AM
Verify the content of the textbox with multiple buttons on Form Gadhadhar Software Development 5 23-01-2010 02:19 PM
Problem of html form with multiple submit buttons ASHER Software Development 4 20-10-2009 05:31 PM
Having asp form with multiple checkboxes to query the database. Broot Software Development 3 09-07-2009 05:12 PM


All times are GMT +5.5. The time now is 11:21 PM.