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
Then you are running into this issue because of using number field:
Unfortunately I have got the same result(
David, uncheck your legacy form rendering option. Then you'll good to go. Settings -> Administration -> System Settings -> Beneath of General Tab and set it to 'No'
Please check this thread, you might have the same issue here:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156