javascript - Send form url without JS -


I have a

  by JS < Form id = "send some wars by custemail" action = "mail / out.php" method = "post" & gt; .... & lt; Input type = "submit" value = "create and send" & gt; & Lt; / Form & gt;  

I need to change the post url on a PHP url. I should change my JS code so that it can work. I mean, I do not want to use the URL: "mail / out.php", in my JS or I can use other on the JS side but I do not know how to use them from the PHP is. I have 8 different situations.

JS Code:

  $ ('#'). Click (function () {$ .prompt ("What is customer's email?", "", Function (value) {$ .ajax ({url: "mail / out.fp", type: 'post', data : $ ('# Custemail'). Serialize (),}). (Function (data) {$ .msg ("" + + '' ') "}");}, function () "$ $ .msg "(" You have been canceled! ");});});  

You can use the JS to catch the URL from the action attribution of the action.

You can also catch it with yourself:

Var url = $ ("#customemail"). Attr ("verb");

The above code will return anything that is included in the action attribute of the form, so you have to do "$ url: url" at $ .ajak call.

I think the second option is as good as it does not require the full plugin, but the plug-ins which AJAXSubmit is also included is very good and it is worth checking.


Comments