Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-11-2007, 10:43 PM   PM User | #1
Qulor
New to the CF scene

 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Qulor is an unknown quantity at this point
Mutiple Actions in 1 form

Hey

On my website i got a registration form. Works very well with action="..."
But there's one problem. I need to add a second action within the same form!

One will be the registration so action="register.php"
and they other needs to send the data to a second online database

I came up with something like:

Code:
javascript:
function submitForm()
{
var myForm = document.myForm;
window.???(????);
}
</script>
<form name="Registration" action="register.php">
<input type="text" name="username" /><br />
<input type="password" name="password" /><br />
<input type="button" value="Submit" onClick="submitForm();" />
</form>
I don't know what to put on the ???

Last edited by Qulor; 12-11-2007 at 10:46 PM..
Qulor is offline   Reply With Quote
Old 12-12-2007, 12:48 AM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,468
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
The usual way to handle a form that needs to perform two (or more) tasks is to set up the one action to do everything. If necessary you can have the called script perform the first action and then pass the form values to a second script to perform the second action.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:48 AM.


Advertisement
Log in to turn off these ads.