$("#play_port").formValidator({onshow:"{-$lang.p2s.js_play_port-}",onfocus:"{-$lang.p2s.js_play_port_form-}",oncorrect:"{-$lang.oncorrect-}"}).regexValidator({regexp:"^\\d{1,5}$",onerror:"{-$lang.p2s.js_port_error-}"}).functionValidator({
fun:function(val,elem){
$.ajax({
type: "get",
url: "{-$site_url-}/ajaxcheck.php",
data: "tablepre=p2s&a=palyport&playport="+$("#play_port").val()+"&track_address="+$("#track_address").val(),
dataType: "json",
success: function(data){
if( data.rv == 0 )
{
$.formValidator.setTipState(elem,"onCorrect","{-$lang.oncorrect-}");
return true;
}
else
{
$.formValidator.setTipState(elem,"onError",data.val);
return false;
}
}
});
}
});
fun:function(val,elem){
$.ajax({
type: "get",
url: "{-$site_url-}/ajaxcheck.php",
data: "tablepre=p2s&a=palyport&playport="+$("#play_port").val()+"&track_address="+$("#track_address").val(),
dataType: "json",
success: function(data){
if( data.rv == 0 )
{
$.formValidator.setTipState(elem,"onCorrect","{-$lang.oncorrect-}");
return true;
}
else
{
$.formValidator.setTipState(elem,"onError",data.val);
return false;
}
}
});
}
});