Page 1 of 1

How can I prevent a service from being executed?

Posted: Tue Dec 29, 2015 10:06 pm
by Ellen Schlechter

I am using this code to check if there are any special characters in the input box. If there are, it fires the alert and runs a create service.

What can I do to prevent it from executing the create service when there are special characters?

var checkString = Appery("mobiletextinput_7").val();
if (checkString != "") {
if ( /[A-Za-z\d]/.test(checkString)) {
alert("Please enter only letter and numeric characters.");
Appery("mobiletextinput_7").focus();
return (false);
}
}

I run this code on value change, but the alert fires when I press the button that should run the service.