ceeleelewis
Programmer
Hello,
I am a newbie to JavaScript. I want to regulate what is entered into a text field box so I can make sure that users are entering the correct information.
Example: (I have a free-form text box named "Colors"
<input type="textbox" name="Colors" value=<%rsCrayons%> />
(I want my user to either enter....
"Orange", "Red" or "Blue"
if the user enters "Pink" as a value than they should receive an error message saying "You can only enter the colors "Orange" "Red" or "Blue". Please change than re-submit edits.)
It's seems that this should be fairly easy.In psuedo code the expression would look something like this....
document.Color.value="Orange", "Red" or "Blue"
if value=""or "Pink","Yellow","Gray","Black"
then
alert.msgbox"You can only enter the colors "Orange" "Red" or "Blue". Please change than re-submit edits."
Am I on the right path here, If not please explain to me my error.
I am a newbie to JavaScript. I want to regulate what is entered into a text field box so I can make sure that users are entering the correct information.
Example: (I have a free-form text box named "Colors"
<input type="textbox" name="Colors" value=<%rsCrayons%> />
(I want my user to either enter....
"Orange", "Red" or "Blue"
if the user enters "Pink" as a value than they should receive an error message saying "You can only enter the colors "Orange" "Red" or "Blue". Please change than re-submit edits.)
It's seems that this should be fairly easy.In psuedo code the expression would look something like this....
document.Color.value="Orange", "Red" or "Blue"
if value=""or "Pink","Yellow","Gray","Black"
then
alert.msgbox"You can only enter the colors "Orange" "Red" or "Blue". Please change than re-submit edits."
Am I on the right path here, If not please explain to me my error.