Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    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/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •