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 Link to comment https://forums.phpfreaks.com/topic/25679-simple-javascript-question/ 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 Link to comment https://forums.phpfreaks.com/topic/25679-simple-javascript-question/#findComment-117249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.