How can I restrict a textfield to specific alpha characters of a single entry, but in a textfield that should have a limit of two spaces to allow a combination of two letters?

I want to force the user to limit the entries in a textfield using only four entries unique alphabet (E, C, W or A), plus an entry of two-letter alphabet "na". I have a textfield with a limit of two characters. Right now, it is possible for the user to enter two of the same entries properly alpha. How to prevent the user to enter only a single entry, at the same time allowing the user to enter the entry "na"?

Oh OK, I thought that was simply a consequence of you only allows one entry alphabetical, never understood you wanted as a characteristic to have AutoComplete from "n" to "na".

You miswrite that last comment? As noted above, you stated that "I had hoped limit the entry of"na"in lowercase. Is it just for the entry? You want the output to always be capitalized?

If this is the case you simply remove the statement on the exit event making this.rawValue.toUpperCase (trigger) each time. And seeing you want to limit the entry for "na" to a single "n", you can delete the statement in the "verification of entry" or "na".

On change:

If (! xfa.event.newText.match(/^(e|c|w|a|n)$/i))

{

XFA. Event.change = "";

}

To the output:

If (this.rawValue == "n") {}

this.rawValue.replace(/n/g,"na")

}

this.rawValue = this.rawValue.toUpperCase)

Are you sure that this would be no 'wrong' user? willing the entry "na" and only able to enter "n"?

In your code you also have double returns 'replace(/n/g,"na") '? One off the if statement and one inside? From my point of view if one is enough. As right now it will evaluate to 'naa' in the case that the user enters "na" (I tested in a fictional form).

Maybe it's because you think you want to restrict the user to only be able to enter the "n" of single entry.

If you feel that your question is answered please feel free to mark a correct answer so that the thread will be properly tagged as well (I guess you have all the tools you need to find the exact behavior you are looking for).

Best regards, Mattias.

Tags: Adobe LiveCycle

Similar Questions

Maybe you are looking for