HTML - <select Option Problem
Hi:
Problem with understanding/using the <select /> clause. I would like the page sent to the user (upon loading) to show the chosen location (i.e., a State of the USA) when I send an updated page with a specified 'Value' set: Here is an abbreviated portion of my Select Clause: <select name="homestate"> <option selected="selected" value="CA">Select State</option> /*note the 'CA*/ <option value="AK">Alaska</option> <option value="AR">Arkansas</option> <option value="CA">California</option> /* I want California to display */ </select> Note that my 'Value' above for the "selected" option is "CA" (for California). However, if I send this updated page to my user with *his* state as 'CA', it still shows as 'Select State' -- where I wish 'California' to display in the Select Default Box. Question: Is there some way that I can make the Select Clause bring up the word 'California' when it accesses the Value='CA' and so on with other 'value' choices ?? (or does this have to be done (somehow) with Javascript ?? Thanks for any guidance ! -Mel Smith Similar TutorialsHello all, I have a stong question because i can't solve it. I want to creat a drop down list with images beside each row. Usualy on clasic html is something like this: select ... option value /option /select But i want a small image (icon) beside each option from select. See for example: http://www.scrigroup.com/afaceri/con...ate/index7.php on the top page see a clasic select. How can i change it to icon seclect on each option? Thanks for your effort to reply Hi, I want to modify a form where I have some "select option" and input text tags. The thing is that when a user select an option from the "select opcion" tag, according to the option selected I want to print some input text in the form .. how can i do that?. Thks a lot! Hey all! I'm trying to set a predefined value in a <select> menu, that is to say, I want something to be highlighted before the user does anything. I've tried the following: <select name="test" size="2" value="x"> <option>x</option><option>y</option> </select> This does not work. Any advice would be great! Thanks for your time. I have an option list and an iframe. My goal is to change the target source for the iFrame when I select and option from the list. I'm able to do this with normal links like this Code: <a href="video/video-page.html" target="VideoFrame">Video Page</a> But how can I do this with a option list? If i didn't plan on having 50+ different options I would just use normal links however this is not the case. Is it possible to do this? hi guys, I have a form with HTML Code: <select name="myOnClick" onChange="DoSubmission()"> <option value="1">Year 1 </option> <option value="2">Year 2</option> <option value="5">Year 5</option> <option value="10">Year 10</option> <option value="25">Year 25</option> </select> when the user clicks on one of these, it refreshes the page and updates a variable somewhere bsaed on the value. However when it refreshes the value showing is always Year 1. I want it to show the option they have just clicked. Anyone know the code that allows you to choose which one shows up? I can then use php to script which one is selected. TIA Dear All, I find that I can do that in firefox, ie 9, but not ie 8 and ie 7. anyone knows the answer. HTML Code: <select id="resourceTypeTree" name="resourceTypeTree"> <script type="text/javascript">obj158= new Object;obj158.sid = 158;obj158.seq = 1;obj158.lv = 1;obj158.lvText = "首頁";obj158.upLvSid = 1;obj158.isShown = 1;obj158.isNetvigated = 1;obj158.url = "/cle/landingPage.php";obj158.remarks = "";obj158.lastUpdate = "2011-04-18 16:15:50";obj158.uiNextSeq = 0;obj158.nextSid = 160;</script> <option value="158" onclick=selectClick('tree',obj158); >→首頁</option> <script type="text/javascript">obj3= new Object;obj3.sid = 3;obj3.seq = 2;obj3.lv = 1;obj3.lvText = "語文學習基礎知識";obj3.upLvSid = 1;obj3.isShown = 1;obj3.isNetvigated = 0;obj3.url = "/cle/pages/webSiteReferenceList.php?sid=3&upLvSid=1";obj3.remarks = "";obj3.lastUpdate = "2011-04-18 16:28:05";obj3.uiNextSeq = 7;obj3.nextSid = 160;</script> <option value="3" onclick=selectClick('tree',obj3); >→語文學習基礎知識</option> <script type="text/javascript">obj10= new Object;obj10.sid = 10;obj10.seq = 1;obj10.lv = 2;obj10.lvText = "漢字形音義";obj10.upLvSid = 3;obj10.isShown = 1;obj10.isNetvigated = 0;obj10.url = "/cle/pages/webSiteReferenceList.php?sid=10&upLvSid=3";obj10.remarks = "";obj10.lastUpdate = "2011-03-16 13:46:44";obj10.uiNextSeq = 10;obj10.nextSid = 160;</script> <option value="10" onclick=selectClick('tree',obj10); >→→漢字形音義</option> <script type="text/javascript">obj38= new Object;obj38.sid = 38;obj38.seq = 1;obj38.lv = 3;obj38.lvText = "漢字的演變";obj38.upLvSid = 10;obj38.isShown = 1;obj38.isNetvigated = 1;obj38.url = "/cle/pages/webSiteReferenceList.php?sid=38&upLvSid=10";obj38.remarks = "";obj38.lastUpdate = "2011-03-16 14:25:54";obj38.uiNextSeq = 0;obj38.nextSid = 160;</script> <option value="38" onclick=selectClick('tree',obj38); >→→→漢字的演變</option> <script type="text/javascript">obj39= new Object;obj39.sid = 39;obj39.seq = 2;obj39.lv = 3;obj39.lvText = "字形的正體、俗體、異體";obj39.upLvSid = 10;obj39.isShown = 1;obj39.isNetvigated = 1;obj39.url = "/cle/pages/webSiteReferenceList.php?sid=39&upLvSid=10";obj39.remarks = "";obj39.lastUpdate = "2011-03-16 14:25:54";obj39.uiNextSeq = 0;obj39.nextSid = 160;</script> <option value="39" onclick=selectClick('tree',obj39); >→→→字形的正體、俗體、異體</option> </select> Regards, Man Pak Hong, Dave manpakhong@hotmail.com How do I get the selected item from a select option list? I dont need the value I need the text associated with the value. I can get the value with (in vbscript): strValue = .mylist.value Have searched google exhaustively to see how to do this simple thing but have found nothing. Thanks. I have some fields and a Select option, I want to add a new field if I select "Add" option, and remove field when I select "Remove" option, can I do it in very simple JavaScript? Hi, is it possible that, to make select option to allow user enter the text...? user can choose from select option.. if did not in the list, then user might need to enter text. Anyone can help me? Hello friends, i have a small problem with option value syntax... i' trying to send the value exactly like '123'. i want that both singlequotes but the value not taking that value... $string = " '123','234','345' "; $name = one; <option value=$srting>$name</option> but it is not displaying any vlaue.... help me anybady... thank you Info I have a select list on my site that has around 12 entries in it. The problem is that every 5 entries there is a white space entered into the list that I do not want to be there. The only white space I wanted was the very first option I wanted to be white space for a default not entered option in the select list. Does anyone know how to make this problem go away? Hi, I have one select box and for that 30 options are there, but i need to display only 5 with vertical scroll bars when user clicks on select box. How is it possible? Please help. I have a select box with restricted width, due to page layout, and the options listed are wider than the select box. This displays fine in Firefox, because as you open the drop-down the options are displayed full-length. However, IE cuts off the option text at the width of the select box. Consider this example: HTML Code: <html> <head></head> <body> <select name="mySelect" style="width:160px;"> <option>This is a really long select box option</option> </select> </body> </html> Is there a way to get IE to display the entire text? Thanks! Hi: I have a 'Select' Box with approx 60 options to select from. Problem (in IE6 and IE7): When I click on the button to open up the list of options, the list shoots to the top of my monitor screen instead of opening up *below* the input postition on the screen. This does not happen on FireFox or Safari --- only IE (6 and 7) Question: Is there anything I can do to correct this behavior. Thank you. -Mel Smith I have a <select> drop down list. I have a label associated with this element. Here is the code; <select name="v" id="v" value="0" size="1"> <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <label for="v">No. required</label><br /> The problem is that when the user clicks on the text of the label, the value in the <select> list is changed back to 0. For example, the user selects 3 using the drop down list. Then if the user ever clicks on the label's text, this value returns to 0. How can I stop this from happening and maintain the initially diisplayed value of the <select> list as 0? I want to put color in my option box.. How can i do it? thanks =D <html> <bgcolor="black"> <select size="1" name="D1" > <option selected>Punk</option> <option>Sum 41</option> <option>GoodCharlot</option> <option>My Chemical Romance</option> <option>Green Day</option> <option>Blink 182</option> <option>The All American Rejects</option> <option>The offspring</option> <option>30 seconds to mars</option> <option>Tokio Hotel</option> </select> </html> Hey all! Is there a way to pass more than one value using the HTML option tag? I am using HTML and ASP together and so I need a first name variable and a last name variable from a DB2 table to be passed as well as show up together as one value in the drop-down box I have created (i.e. John Doe). As of right now I have figured out how to make it show in the drop-down box as John Doe however, I need the full name to be one value. Hope this makes sense! Thanks! Response.write "<option value=" & rs("FIRST_NM") & ">" & rs("FIRST_NM") & "</option> <option value=" & rs("LAST_NM") & ">" & rs("LAST_NM") & "</option>" How I could make a download option using HTML. Thanks in advance |