function test() {
function validateInput() {
//get the value of the name field
var input = Xrm.Page.getControl("new_testautocomplete").getValue();
if (input != "") {
//check if the last key pressed is a number
if (isNaN(input.substr(input.length - 1)) == false) {
//display the message
alert("Numeric values are not allowed in the account name");
}
}
}
try {
//attach the validateInput function to the keypress event of the name attribute
Xrm.Page.getControl("new_testautocomplete").addOnKeyPress(validateInput);
} catch (e) {
// console.log(e);
alert(e);
}
}
}
*This post is locked for comments
I have the same question (0)