How to force alpha or numeric inside text fields - LiveCycle Designer 9.0

jbyars09

09-11-2010

I am creating a form that requires City, State and Zip.  I need to make sure that users do not put City, State and Zip into the City field; which someone so nicely pointed out to me as a problem with the form.  Anyway, what I am looking for is a way to force the user to only be able to enter alpha characters into the City text field.  I had glanced at the "Validation Patterns" OOTB functionality but I could not find anything listed that would complete the requirement.


Thank you,

View Entire Topic

Radhika_Magaji

05-05-2015

Hi,

I was able to achieve this with the below in my change event:

if(xfa.event.newText.charAt(0).match(/[ `~!@#$%^&*()-_={}|:;."<>,\\\[\]]/g))    

{

  xfa.event.change = "";

}

But the above restricts numeric also from entering at first position i am assuming this is happening cuz im using chartAt() which probably checks only for string.

I need the user to enter either alphabet or numeric at my first character.

Please Help.