asp.net mvc 3 - Remote Validation or Jquery ajax call shoud in ASP MVC? -
i wonder best method valid form in asp mvc.
i have used jquery ajax check username
exits in database. problem when submit form, method need me click username
field execute onblur
function ajax call, doesn't show previous error message.
with remote validation
, execute when leave or focus out username
. problem way can't manage error message such : the username must @ least 3 charaters....
or the username taken
.
anyone can give me suggestion or link how valid form ontime
(it means when user leave out field , go ahead next field, page: http://yame.vn/taikhoan/dangky ) ?
use
$("#username").focusout(function(event){ var name = $(this).attr('value'); if(name.length>=3) { searchcustomer();//function containing ajax call } else { //show error message of length less 3 } });
Comments
Post a Comment