how to avoid the error message if the user leave the option 0 (<option value="0">Select</option>)? Instead use something like this code, but for the list because i get error:Invalid column name
The option 0 (<option value="0">Select</option>) it's needed in my example using jQuery, because the result is displayed when the user makes a selection in the dropdown list.
Otherwise it's not needed: the first row (USD?) is selected by itself and the user can accept or change it before to click the "Go" button.
For the second question, the last row of your code formats the result layout
GmGregori
Contributor
5440 Points
731 Posts
Re: How to select data from database using a dropdownlist
Feb 22, 2012 12:48 PM|LINK
I'm not sure to understand what you mean.
The option 0 (<option value="0">Select</option>) it's needed in my example using jQuery, because the result is displayed when the user makes a selection in the dropdown list.
Otherwise it's not needed: the first row (USD?) is selected by itself and the user can accept or change it before to click the "Go" button.
For the second question, the last row of your code formats the result layout
and you get something like: Result: 1 USD0.045
In your code there are some unnecessary span tags, but, apart from that, you can format the output as you prefer.