I have to pass an extra parameter to funcCall method. How to do that? And What is the use of i in the parameter? I hav to add another parameter probably like this.
<input type="text" id="phone" class="validate[funcCall[checkPhoneNumber["phone"]]]"/><input type="text" id="mobile" class="validate[funcCall[checkPhoneNumber["mobile"]]]"/>
I hav to add switch case inside the following method for phone and mobile which will hav the different regex.
function checkPhoneNumber(field, rules, i, options){
alert(i);
if (!field.val().match(/^[0-9]{8,15}$/))
return options.allrules.phone.alertText;
else if (!field.val().match(/([^((\+)*(0*))])/))
return options.allrules.phone.alertText;
}
I’m using attribute for each input tag and I’m getting the value of that attribute and based on that I’m using my functionality. For example: