Skip to content
Advertisement

Trying to get value out of a select option in the same form

I’m trying to get value out of the select option. But it doesn’t seems to be able to get since it’s on form. How do I do it ? I mean by having taking the value out of the option select.

JavaScript

Advertisement

Answer

1.) You can not select all the items in a select with selected ! Without multiple="multiple"

JavaScript

E.g. topFr[]

JavaScript

if you can have multiple selected the name must be an array here stockid[]

JavaScript

If you get from the <Form> an array you must treat request.getParameter("stockid")as an array !

2.) OR stockid = INT then

You can not pass a string to a field = INT

if stockid is INT !

JavaScript

will set a String to the query and the String will be quoted

wrong

JavaScript

you need

JavaScript

Try

JavaScript

also you should test with for empty !

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement