intrigue Posted October 31, 2006 Share Posted October 31, 2006 I have been searching this but i figure asking would be quicker then all the syntax errors i am bound to make.Please can anyone tell me how i would check a form field for a correct input value of"1""2""3"and nothing else.Thanks in advancematt Quote Link to comment Share on other sites More sharing options...
tomfmason Posted October 31, 2006 Share Posted October 31, 2006 I guess you could do this..[code=php:0]function checkField() { var field = document.getElementById('yourField').value if ((field !== 1) || (field !== 2) || (field !== 3)) { alert('Incorrect field value'); } else { //do something else here }}[/code]Good Luck,Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.