Created
March 30, 2012 00:20
-
-
Save mkeplinger/2245199 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
$('#jq_form_update_address').submit(function(e) { | |
e.preventDefault(); | |
is_valid = $(this).valid(); | |
if(is_valid == true) { | |
var data = new Array(); | |
data.push({ | |
"name" : "email", | |
"value" : v_email | |
}); | |
data.push({ | |
"name" : "fname", | |
"value" : $('#jq_fname').val() | |
}); | |
data.push({ | |
"name" : "lname", | |
"value" : $('#jq_lname').val() | |
}); | |
data.push({ | |
"name" : "address", | |
"value" : $('#jq_address').val() | |
}); | |
data.push({ | |
"name" : "address2", | |
"value" : $('#jq_address2').val() | |
}); | |
data.push({ | |
"name" : "city", | |
"value" : $('#jq_city').val() | |
}); | |
data.push({ | |
"name" : "state", | |
"value" : $('#jq_state').val() | |
}); | |
data.push({ | |
"name" : "zipcode", | |
"value" : $('#jq_zipcode').val() | |
}); | |
data.push({ | |
"name" : "hash", | |
"value" : $('#jq_hash').val() | |
}); | |
$.ajax({ | |
'type' : 'POST', | |
'url' : "/ajax/update_participant", | |
'data' : data, | |
async : false, | |
dataType : "json", | |
success : function(response) { | |
if(response.status == true) { | |
ui_noty("Your details are updated", "success"); | |
} else if(response.status == false) { | |
ui_noty(response.msg, "error"); | |
} | |
} | |
}); | |
} else { | |
ui_noty("Please fill the required fields", "error"); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment