Expand my Community achievements bar.

Auto tabbing not working, why?

Avatar

Level 2
I am not sure as to why the auto advance is not working in the following script. The alert box does appear when a letter is entered in to the field after tabbing out. Also, the field is cleared and focus is in the right field, but when 3 numeric digits are entered it does not advance. I do not have anything on the Object<Value tab. I have tried the same script on the change event and the alert box appears after the 3rd value is entered into the text box no matter if it is a letter or number. I am using LiveCycle version 7.0.0.<br /><br />----- SetupForm.ServiceAuthPage1.Phone2::exit - (JavaScript, client) --------------<br /><br />if (xfa.event.newText.length == 3) <br /><br />{<br />var r = new RegExp("^[0-9]+[0-9]+[0-9]");<br /><br />var result = r.test(this.rawValue);<br /><br />if (result == true)<br />{<br />xfa.host.setFocus("Phone3");<br />}<br />else if (result == false)<br />{<br />app.alert("Please enter a valid area code.");<br />Phone2.rawValue = null<br />xfa.host.setFocus("Phone2");<br />}<br />}
0 Replies