/ Published in: JavaScript
This send any value via POST to a PHP page. It is done with AJAX, so the POST return can be used on the same page as the submit
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// On click "button.submit" $("button#submit").click(function () { // Send to submit.php $.post("controller/submit.php", { // Send these values via POST val1: $("#val1").val(), val2: $("#val2").val() }, function(result){ // Return result $('#output').html(result); }); });