Answered
How do i check to see if a field contains any non-numeric characters?
I want to pull a value from a field and perform calculations on it but if the field contains any non-numeric characters I want it to do nothing.
I want to pull a value from a field and perform calculations on it but if the field contains any non-numeric characters I want it to do nothing.
You can use a regular expression for this. For example:
var v = this.getField("Text1").valueAsString;
if (/\D/.test(v)) {
// the field contains non-numeric characters
} else {
// the field is empty or contains only numeric characters}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.