I have five forms in the page. I have my validation also in place using jquery validation plugin. There is this odd little case where I want to cover - wherein the server returns no results (for any of the forms) and I need to display the same jquery validation. I was able to do that with :
$("#form1").validate().element( ".myid" );
Now I am stuck at the implementing this for all five forms (five forms- five fields respectively).
One way being the legacy if-else way
var re5digit=/^\d{5}$;
if (document.myform.myid.value.search(re5digit)==-1){
alert("1");
}
(if (document.myform.myid2.value.search(re5digit)==-1){
alert("2");
}
...
OR ask you for a jquery hack that could find me the current cursor position and I could call the validate? suggestions?