PDA

View Full Version : Submitting two forms using one button



davindersangha
10-26-2005, 09:48 AM
I want a user to enter a mobile number into a field.

I then want one submit button which does the following:

Send the mobile number (as part of a Form action to a URL)
Send the mobile number to an email address using something like MAILFORM and then redirecting the user to a THANK YOU landing page.

mwinter
10-26-2005, 04:17 PM
Send the mobile number (as part of a Form action to a URL)
Send the mobile number to an email address using something like MAILFORM and then redirecting the user to a THANK YOU landing page.The first is simple:



<form action="/some/resource?any-other=query-string&name=value-pairs" method="get">
<!-- ... -->
<label>Mobile number: <input type="text" name="number" value=""></label>
<!-- ... -->
</form>


The second is also simple in isolation, however it's not possible to do both as if they're separate operations. The server-side script that will receive the submission must do both. Though there are other possible alternatives, they aren't worth considering.

Mike