On Mon, Jul 7, 2008 at 9:02 AM, Mahbub <[EMAIL PROTECTED]> wrote:
>
> There's actually no way of submitting a form twice in two action urls
> in normal browser's capability. What you can do is that serialize all
> your variables into string using serialize() and use AJAX to submit
> into two locations one after another. like this
>
> <form action="" id="pform" onsubmit="return submit_my_form();">
> <input type="text" name="input1">
> <input type="text" name="input2">
> </form>
> <script language="javascript">
>
> function submit_my_form(){
>   $.ajax({
>     url : "url1.php",
>     type : "post",
>     data : $("#pform").serialize(),
>     success : function(e){
>      // so form is submitted successfully !!
>     }
>   });
>
>   $.ajax({
>     url : "url2.php",
>     type : "post",
>     data : $("#pform").serialize(),
>     success : function(e){
>      // so form is submitted successfully !!
>     }
>   });
>   return false;
> }
>
> </script>
>
> Hope this helps!!
>
> On Jul 5, 5:18 am, xomero <[EMAIL PROTECTED]> wrote:
>> How can i submit a form twice, let say I want to save the form data on
>> my database and with the send the same form data to a different script
>> in an external host.
>


i would handle that on the serverside of life, not the clientside.
basically, your serverside script processes the form, saves it in a
database, then if all correct, call the external form, via GET (that
is, as query variables).

-- 
Alexandre Plennevaux
LAb[au]

http://www.lab-au.com

Reply via email to