jQuery.Validate -- remote 多参数传递

http://www.rsywx.net/jquery/demos/index.html

表单:
remote:{
      url:"{:U('Public/reCheckEmail')}",
      data:{
       uname:function(){
          return $("#rename").val();
          },
       reemail:function(){
          return $("#reemail").val();
          }  
       }
      }

 

php处理:
  $username = t( $_REQUEST['uname'] );
  $email    = t( $_REQUEST['reemail'] );
 /**
  $file = fopen(SITE_PATH."/test.txt","w");
  fwrite($file,$username."|".$email);
  fclose($file);
*/

 if (D("Members")->where("uname='".$username."' and email='".$email."'")->find()) {
    echo "true";
  }else{
   echo "false";
  }

 

格式:
remote:{
   url:"",
   data:{
      par1:function(){   return $("#field").val(); },
      par2:function(){}......
   }

}

你可能感兴趣的:(php,jquery)