AJAX implemented with zend framework on ONBLUR Property of input box -


i new in zend framework. want implement ajax zend framework. want call ajax on onblur property of input box dispaly message.

in form file can add add

->setattrib('onblur',"checkemailexited(this.value);") 

for email validation @ text box.

in view file or in javascript can call custom function like

<script lanaguage="javascript">     function checkemailexited(email){    jqobj.ajax({        type: "post",        url: "<?php echo $this->url(array('controller'=>'index','action'=>'checkemail','module'=>'ajax'))?>",              data: "email="+email,         success: function(data){          if(data == 1){          var massage = "that email address unavailable <span class='hint-pointer'> </span>";         jqobj("#email_m").css({'display':'block','color':'red'});        jqobj("#email_m").html(massage);        return false;        }else{         }        }      });   }  </script> 

controller file

public function checkemailaction(){

$this->gethelper('layout')->disablelayout(); $this->gethelper('viewrenderer')->setnorender();  $objrequest = $this->getrequest(); $objmodeluser = new models_user();  $emailaddress= $this->_getparam('email');  $emailflag =  $objmodeluser->checkemailexisted($emailaddress,"");  echo $emailflag; exit;  

}

let me know if can more


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -