views:

491

answers:

1

Hi i have a form that uses JQUERY to send an email containing name and email.. Im just wondering why on the first attempt the validation works but if you submit it again.. it doesnt refresh the validation and in addition, the fancybox that im using looks it getting an infinite loop and i can close the box anymore..

any solution or something wrong with my code?

    str = $("#frm_optin").serialize();
$.ajax({
 type:"POST",
 url:"optin.php",
 data:str,
 success:function(msg){
  $("#success").ajaxComplete(function(event, request, settings){
   if(msg=='OK'){
    $("#success").fadeIn();
   } 
   else{
    $("#error_msg").html(msg);
           $("#inline").fancybox().trigger('click');
   }
  });
 }
});  
return false;
A: 

hi there

any idea ?

x_cem