Hi All,
I'm trying to apply regular exp. for URL which should accept normal standard
but it is not happening
here is the code :
function URLtest() {
//var alertreq = false;
var testres = true;
var URLvali = "/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/";
var name = Xrm.Page.getAttribute("new_websiteurl").getValue();//nameeld where u want to check the special character
for (var i = 0; i < name.length; i++) {
if (URLvali.indexOf(name.charAt(i)) != -1) {
testres = false;
}
}
if (testres == false) {
Xrm.Page.getControl("new_websiteurl").setNotification("Website formate should be in correct format");
}
else {
Xrm.Page.getControl("new_websiteurl").clearNotification();
}
}
Plz let me know if any changes required coz it is throwing error for correct format also.