Specify Numbers for Validation Field...

User 412479 Photo


Registered User
45 posts

Thank you in advance for your help. Javascript is just a bit much over my head to figure this out from searching this forum and the web for answers. :/

A client is going to allow people to call in and pay by phone. I set up a check box for them to click if they phone in. If they click that check box, another box will come up beside it asking them for a code. There will be one of two 4-digit codes they will give someone on the phone.

How do I put that for the phone code box there are only two 4-digit numbers that will be accepted if typed in it?

Thanks again. I know this should be easy, but I'm just not knowledgeable enough for it. I'm attaching my .fb file.
Attachments:
User 412479 Photo


Registered User
45 posts

Never mind! Just figured out regular expression to use (had one-set mind on js use) during another web search :)

/^[number you want to use][other number you want to use]+$/

I thought I did but the 2 four digit numbers I entered, it'll take any combination of those 4 numbers. I'll keep looking until someone gets it and posts here or I find out what's missing to make it work to do what I need to :)
User 412479 Photo


Registered User
45 posts

Yeah got it :) If anyone needs in future:

!(3200|0023)!
Will only allow one of those 2 numbers

Sorry if this is somewhere already, like I said, was on a one-track mind with javascript, didn't think about regular expression.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.