Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- // Setup form validation on the #register-form element
- $("#register_form").validate({
- // Specify the validation rules
- rules: {
- register_username: "required",
- register_password: "required",
- register_email: {
- required: true,
- register_email: true
- },
- register_confirm_password: {
- required: true,
- minlength: 5
- },
- },
- // Specify the validation error messages
- messages: {
- register_username: "Please enter your username",
- register_password: "Please enter your password",
- register_confirm_password: {
- required: "Please provide a password",
- minlength: "Your password must be at least 5 characters long"
- },
- register_email: "Please enter a valid email address",
- },
- submitHandler(function(form) {
- $.ajax({
- type: 'POST',
- url: $(this).attr('action'),
- data: $(this).serialize(),
- dataType : 'json',
- success(function(data) {
- if (data){
- alert("success");
- // $(this)[0].reset();
- }
- })
- });
- return false;
- });
- });
- });
- var_dump($_POST);
- submitHandler(function(form) {
- $.ajax({
- type: 'POST',
- url: $(this).attr('action'),
- data: $(this).serialize(),
- dataType : 'json',
- success(function(data) {
- if (data){
- alert("success");
- // $(this)[0].reset();
- }
- })
- });
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement