Hi all,

I was wondering if somebody could help me...

I have a form field which I want to lock down so users can only enter a specific combination

eg. first character is a letter - can be either B,C,W,F,A,H which is followed by seven numbers.

I have got some script which only accepts numbers but I do not know enough about javascript so that I can amend it to accept the leading character.

Thanking you all in advance

please?

This may help :

http://ginger-space.blogspot.com/2007/07/javascript-validation.html

Amend and expand the code that's in there checking which character you're on and using an ASCII chart to find the codes for the letters you want to allow in position 1. You could also check for the lower-case values and convert to the upper-case values, if you wanted to.

Anthony


Hi! If am known which are the exact letters that should be allowed to be entered in the Input Text field, Then only I can try to find a solution of the same.


Regards

Rupam Datta

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.