Created
June 30, 2011 09:53
-
-
Save iksela/1055947 to your computer and use it in GitHub Desktop.
Remote validation
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
| $("#form").validate({ | |
| rules: { | |
| code: {minlength:3,maxlength:6,remote:'validate.php'} | |
| }, | |
| messages: { | |
| code: { | |
| remote: 'This code is already in use.' | |
| } | |
| } | |
| }); |
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 | |
| // the value is passed as a get parameter | |
| $code = $_GET['code']; | |
| $valid = false; | |
| /* if code available --> put $value = true; */ | |
| echo json_encode($valid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment