Last active
October 12, 2016 21:15
-
-
Save svenl77/61282aea5f9ed41985c868279635cbb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Form::open ("test", $values, ["ajax" => "finishCallback"]); | |
Form::hidden ("id"); | |
From::Button ("Submit"); | |
Form::close (); | |
?> | |
<script> | |
function finishCallback (data) { | |
console.log (data.status); | |
console.log (data.message); | |
} | |
</script> | |
<?php | |
// Reply example | |
$reply = ["status" => "OK", "message" => "all is good"]; | |
header ("Content-type: application/json"); | |
echo json_encode ($reply); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment