Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('#my_form').submit( function (e){
- var is_need_submit = false;
- e.preventDefault();
- var str = $(this).serialize();
- $.ajax({
- type: "POST",
- url: "/ajax.php",
- data: str,
- success: function(msg) {
- $("#my_error").ajaxComplete(function(event, request, settings) {
- if ( msg == 'OK' ) {
- is_need_submit = true;
- }
- else {
- $(this).html(msg);
- }
- });
- }
- });
- return is_need_submit;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement