473,938 Members | 11,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set the value of <select> dynamically

17 New Member
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>
  5.  
  6.  
thx in Adv,
HAN.
Aug 17 '07 #1
2 3054
drhowarddrfine
7,435 Recognized Expert Expert
I don't have a clue what any of that is. It's not HTML.
Aug 17 '07 #2
gregerly
192 Recognized Expert New Member
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='selec ted'>This option is selected</option>
<option value='someOthe rVal'>Some Other Val</option>
</select>[/HTML]

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

Hope that helps.

greg
Aug 17 '07 #3

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

Similar topics

1
2426
by: Ang Talunin | last post by:
Hey, I wondering if it's possible to retrieve all the <option>-fields from a <select> when posting a <form> to a php file Example: I've got a form like this: <form action = phpfile.php method=post > <select name= "name">
3
23348
by: Darren | last post by:
Please Help Me!! I've created a typical <form> and a <select> element. The options are created dynamically from my access database (using asp). There are about 70 options, and when you click the dropdown button, it shows about 25 (depending on screen resolution) and then the gives you a scroll bar to get to the rest. My question is, can I limit the number of options shown when you click
3
15103
by: Chamomile | last post by:
I've only just come accross this newsgroup, so apologies if I seem to be cross-posting... this may be an old chestnut, but has anyone ever come accross a straightforward way of styling a <select> element? In particular the (always grey?) drop-down button color. (This, and the 'Browse' button on an <input type='file'> seems forever doomed to eternal greyness.)
2
11743
by: Aaron C | last post by:
This is kindof a newbie question, so please bear with me... I need to pass the selected option of a <select> tag into a query string, so that the page is reloaded with the selected option already chosen. This will occur with the onclick() event hander, and the query string will be processed using a server-side technology. I'm just not sure how to word the "onclick" handler. Here's what I have: <select id="StartMonth" name="StartMonth"...
6
2421
by: Bonge Boo! | last post by:
This has got to be obvious, but I can't make it work. I have a form called with 3 pull down menus. They are linked to a database which generates the values for the <SELECT? Pull-downs. Lets say I have values selected for all three pull down menus. When I change the first "top-level" menu I want to reset both the second and third menus to the "default" state.
6
19625
by: joseph.lindley | last post by:
Forgive me for I am a bit of a web-dev novice - but I'm not doing too bad. I'm currently working with a bit of javascript to dynamically add <option>s into a select box. My code currently works fine in Internet Explorer, however in Firefox the dropdown only displays the first option in the list, and when clicked the other values aren't displayed. Here is the code;
5
1566
by: andreas.maurer1971 | last post by:
Hi everybody, I nearly get despaired of the fact that the events I chose and, according to the MSDN site, are correct, don't fire reliable in IE6. Is someone able to tell me, which events I can use for the following situation? I have a <select> list with dynamically generated options. Latest when I have changed the (pre-) selected option and loose the focus of the select-list I want to run a function to find out about the newly
3
3000
by: veg_all | last post by:
Say I have: <select> <option value='a' > First <option value='b' > Second <option value='c' > Third </select> Is there a way I can access the values First, Second and Third from an array ? I want to write a javascript function that can
2
6209
by: mitch | last post by:
I have a <select> that's inside a <td> and I want to dynamically show and hide the select. If elem is set to the <select> and I do either of these: elem.style.visibility = "hidden"; elem.style.display = "none"; it works in Firefox, but not in IE. In IE the page doesn't change at all.
0
10133
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11521
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9854
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7379
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4444
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3498
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.