Validating dropdownlist in javascript


I am pretty new to programming in OOP, I understand linear programming fine, but java adn javascript has so much built in stuff, and it is not very english like, I can follow logic and understand it and even tweak it, but I am not familar enough w/ the syntax and OOP to make up my own yet.

Well I tried your pretty code, and that is much easier, thanks for the tip, but it didn't work, like I said, its a mystery, it works for item1 and item2 -- go check it out but when its gets to item3 --nothing..frustrating, cause its exactly the same, I literally copied and pasted the else if I made for item2 and just changed the numbers..nothing..the same it should figure out whats wrong? It is because you have nested all of your IF statements.

Remove the And your right it does...thank you so much, I got thrown off because when I edited the script from a differnt one I have used before for a simpler form, i left out an didn't work..I assumed I needed elses everywhere but now it kind of makes sense.

In this article you will see how to put validation in dropdownlist by javascript, suppose first item value of dropdownlist is 0 and text is "-Select-" just like given below and we have to validate that at least one item is selected excluding default i.e "-Select-".

The server would then need to send all the data back to the client and request that the form be resubmitted with the correct information.

The following function would work for that purpose, just pass the value in the textbox to the function to verify if all are numbers.

thank you so much for the phone validation, I will try it out right now.

Using client side Java Script is an efficient way to validate the user input in web forms.

When there are many fields in the form, the Java Script validation becomes too complex.

ok now i want to validate that if the drop box has a value other than blank, i want to check its corresponding quantity, if the quantity is blank then I want it to say 'please enter a quantity on Item -" here is the drop down boxes with the quantitys But if you also want to verify that it is a number and not any other character.

You must have an account to comment. Please register or login here!