471,598 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

how to set the value of <select> dynamically

hi all,
I have a problem with <html:select> i am getting a value from the database
but it is not setting to my <select value>. Can any bady tellme what is the problem. My code is given below..

Expand|Select|Wrap|Line Numbers
  1. <html:select property="conttitle" styleClass="dropdown" value="${conttitle}">
  2.         <html:option value="1">1 - Mr</html:option>
  3.         <html:option value="2">2 - Ms</html:option>
  4.     </html:select>
thx in Adv,
Aug 17 '07 #1
2 2953
7,435 Expert 4TB
I don't have a clue what any of that is. It's not HTML.
Aug 17 '07 #2
192 Expert 100+
I don't have a clue what any of that is. It's not HTML.
Wow, what is that? a select tag looks like this:

[HTML]<select name='myselect'>
<option value='someVal' selected='selected'>This option is selected</option>
<option value='someOtherVal'>Some Other Val</option>

If you want the option to be selected by default, you just have to add "selected='selected'" attribute.

Hope that helps.

Aug 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ang Talunin | last post: by
3 posts views Thread by Chamomile | last post: by
5 posts views Thread by andreas.maurer1971 | last post: by
2 posts views Thread by mitch | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.