Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

How can I prevent a service from being executed?

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.

Return to “Issues”