Is there a way to specify two actions on a single form.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Is there a way to specify two actions on a single form.

  1. #1
    Dan Guest

    Re: Is there a way to specify two actions on a single form.

    You can just perform the 1st action and when done, change the form's
    action and resubmit it with some timing in between, ->


    <form action="/cgi/cheese.pl">

    <input type="button" value="Submit this darned thing"
    onClick="submitTwo(this.form)">

    </form>


    function submitTwo(theForm)
    {
    theForm.submit();
    setTimeout('theForm.action=\'\/cgi\/macaroni.pl\'',3000); // waits 3secs
    before changing the .action property, so the codes don't conflict
    setTimeout('theForm.submit()',5000; // 2secs after the .action property
    has been changed, it submits it

    }


    Dan

    "Mayuresh" <mektare@hotmail.com> wrote in message
    news:3c88f5e6$1@10.1.10.29...
    >
    > Hello,
    > I need some help with forms. I need to perform two actions when the html
    > form is submitted,
    > 1. send the form data to database (done by javascript)
    > 2. e-mail the form data (done by a cgi script)
    >
    > Is there a way I can have the form perform these two actions with a single
    > click on the submit button.?
    >
    > Thanks for the help.
    > -Mayuresh




  2. #2
    Mayuresh Guest

    Is there a way to specify two actions on a single form.


    Hello,
    I need some help with forms. I need to perform two actions when the html
    form is submitted,
    1. send the form data to database (done by javascript)
    2. e-mail the form data (done by a cgi script)

    Is there a way I can have the form perform these two actions with a single
    click on the submit button.?

    Thanks for the help.
    -Mayuresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center