Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Set focus on phone number field when validations fails

$
0
0

Hello,

I have a text field set up as a phone number field, with the following in the change event to accept numbers only:

 

if(xfa.event.newText.match(/[^0-9]/)){
xfa.event.change = "";
}

 

In the Pattern validation, I have this mask on all tabs (Display, Edit, Validation and Data):

text{'('999')' 999-9999}

 

I want the user to be able to just enter numbers and have the parentheses and dash added automatically ["(123)-456-7890"].


How do I get the focus to stay on this field when it fails validation? (e.g., insufficient or too many digits).  I have looked into validationState but couldn't figure out how to use it (I'm a noob javascripter).

Thanks for any help.


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>