HTML - Adding Categories To Select Options
I have a select option that I want to categorize the values for. I want a space (if possible) between the categories and I want to show the category heading before the options for each category. The "value" for the non-heading options is a unique id that I get from an array taken from a database. I am populating the select using an asp for loop. Here is an example:
Code: <select> <%For i = 0 to UBound(Controls, 2) - 1)%> <option value="<%=Controls(0, i)%>"><%=Controls(1, i)%></option> <%Next%> </select> Any idea on how I can do this? Thanks a ton in advance!!! Similar TutorialsI have a SELECT selection list (standard code), in a form which is 200px wide (located in the sidebar of a web page). Some of the OPTION elements in the list can be quite long. In FF, this isn't a problem as when you click on the dropdown arrow, the dropdown box is widened so each option text can be seen fully. But in IE, the dropdown box is limited to 200px wide, so you can't fully see some of the options. Is there any way to solve so you can fully see the options in IE? Thanks, James Hey, just a quick question... How would i go about using an image as a select option in a form? i know its possible as ive seen it around on a few sites before, but im not sure how to do it myself. tried the obvious: <select name="stars"> <option value="1"><img src="MYIMAGE"></option> </select> but oviously that doesnt work. any help would be greatly appreciated. I have a long list (say, 10,000) to be populated in the html select (Multiple with size, say 10 visible at a time) control. I don't want to populate all the items initially. Hence, Initially, I will load top 100 items and whenever user scrolls down and reaches the bottom of the list (say, after crossing 85th item), I want to populate the next 100 items (101th to 200th). I am using javascript to populate the options. The question is: 1. How to identify that the user is reaching the bottom of the control? Is there any way to identify whether a option is visible or not to the user? Thanks in advance, R. Amirdha Gopal. im makeing a page to store files.. how do i hide the page link so it doesnt show the categories (btw my index is .com/*****/*****/index.html) & if its possible to make it so that the browser doesnt show the category in history... (only .com) Thanks! Could someone tell me what's involved or suggest a way that I could have a table full of info made up of store names, state/province, address, phone numbers etc. that could instantly be sorted by one of these categories. I have a menu bar, viewable at http://muskmagazine.com/february/index.html, where I want some columns not to have a hyperlink but to keep the default cursor. I have tried not including the href but this then changes the cursor from default. Not being to savvy with HTML I could do with some help. Thanks Justin Sample menu code: <li><a href="#">about us</a> <ul> <li><a href="pressrelease.html">press releases</a> <li><a href="letterstoeditor.html">letters to the editor</a> <li><a href="newsletter.html">newsletter</a> <li><a href="contact.html">contact</a> <li><a href="aboutus.html">mission statement</a> </ul> </li> css code: http://muskmagazine.com/february/menu/fsmenu.css Hi All, I would like to create a drop down box that contains number 1-50. I know I can do this using the following <option value="1">1</option> <option value="2">2</option> Can someone tell me a method for doing his a better way rather than having 50 option values? p.s is the speaking advert at the bottom of this forum the most annoying thing ever. Does nothing for me as a new site visitors other than make me want to leave. I have turned the sound off now but its real pants. Thanks all Kind Regards wedmonds ello everyone. I'm looking for a new way to display information effectively and neatly on my website. I have looked into tables ( which I am not a fan of ), also Javascript displaying clickable tabs allowing information to be displayed when tabs are clicked. My website is animal related so i need to be able to display somewhat like shown below; Does anyone have any other ideas of how I could display this information without making my website look rubbish? Thanks Jake Hi, Is it possible in HTML to have the list box <select >, with some of the option with different Font , may be just BOLD or italic will do my job. This is because i want to separate some option with others. Like: tableName1 ColumnName1 ColumnName2 ColumnName3 tableName2 ColumnName1 ColumnName2 ColumnName3 I want to display these in LIST box, it will be good if tablename are in BOLD or in different Font. Also i have to make them unclickable. Right Now i am doing this via: but this approach is not looking good Code: function selectionChange( selectElementID ){ if ( document.getElementById( selectElementID ) ) { var selectBox = document.getElementById( selectElementID ) ; if ( selectBox.options[ selectBox.selectedIndex ].value == "unSelectable" ){ alert ( "Select any Table, not the Schema " ); selectBox.selectedIndex = -1; } }else{ alert ( "Debug: check the code given id: '" + selectElementID + "' is not valid." ); } } Thanks Rakesh Juyal Hello All! Is there a way to specify "no-indent" on the <optgroup> tag. When using this tag, all the options get indented and it wastes a lot of space on the screen. Any ideas would be great. Example: <select name="blah"> <optgroup label="hello"> <option style="color: #ff0000" value="test">test</option </optgroup> </select> as you can see, the style tag works for color, but I can't find any css that will put the indent to zero. thanks. Hi guys, Can someone please help me with what to do with my forms; I have a form built that when someone clicks submit I want a number of actions to occur: - The information they provided to be emailed to me somehow - A message to pop up saying that the form was successfully submitted. - And to redirect them back to my home page. How do I do this?? What code do I need to use?? And is there some way that I can get the filled out form emailed to me without them having to send it?? (i.e. not using "mailto") Any help here would be really appreciated. Thanks, TroubleShooter..."yeah right!" Hi All! I'm using the Option Group/ optgroup/ Select features within a form and would like to initially display all options without having to click the arrow button to "reveal" the selections. I can't seem to find the option to allow this. Of course I can switch to a hyperlinked list, but have made extensive Option Group and would like to continue to use them. Thanks in advance!! Hello All! I don't have access to any kind of server side scripting. The file I am making has to be able to run on a desktop other than the scripting for the search functions. I have a few sites that I am incorporating their search function into the HTML doc. It's a time saver but I am only having 1 hiccup. The design. I was not aware on how to incorporate into a radio button and/or drop down to search each site separately. Some of them require hidden fields that make this a challenge anyhow. I'm not sure how to design the page in order to make this work fluently. I currently have a top frame with the navigation bar and the bottom frame as the main window. When a user clicks the link, it will load another top frame doc with the nav bar and a search window for that site clicked on. So when the user types in the information, it submits it to the site and shows the results on the main frame. If they click another link, it displays a search box for that site, and same thing. However, I was wondering if there was a cleaner way of doing this? I am really interested in keeping a navigation bar but it looks cluttered with a search bar. I'm having to create a separate page for each search bar and add the navigation bar to each one. Then if something changes with the nav bar, I have to go back and fix each page. I'd really be happy to only need one nav bar. My goal would be to figure a way to keep a navigation bar, clean up the page, and keep each search function handy. I could create a 3rd frame but I think it would feel more cluttered. Here is the menu bar. Of course, this is just an example. "Form" is name of top frame. Code: <ul class="menu"> <li><a href="choose.htm" class="active"><Span>Home</span></a></li> <li><a href="Tool.htm" target="form" onClick="top.body.location='www.example.com/sitewheresearchislocated';"><Span> etc.... </ul> And here is the frame page. Code: <frameset rows="80, 1*"> <frame frameborder=0 scrolling="no" noresize="noresize" src="choose.htm" name="form" framespacing="0" border="0"> <frame frameborder=0 noresize="noresize" src="main.htm" name="body" framespacing="0" border="0"> </frameset> hi everyone, ok heres my problem that is bugging me. I have a ecommerce website that im setting up and it comes with a default search feature. Code: <form name="quick_find" action="MYDOMAIN/index.php?main_page=advanced_search_result" method="get"> <input type="hidden" name="main_page" value="advanced_search_result" /> <input type="hidden" name="search_in_description" value="1" /> <input type="text" name="keyword" size="18" maxlength="100" style="width: 103px; margin-right:5px; vertical-align:middle;" value="" onfocus="if (this.value == 'Enter search keywords here') this.value = '';" /> <input type="submit" value="Search" style="width: 50px; vertical-align:middle;" /> </form> on my site i sell music LP's and each lp has in its description the year it was released. If i was to put in the above form "1996" it would search all my products and return any that have "1996" in their desctiption. With this in mind i would like to create a form that had 4 drop down boxes. day,month,year,country I have created the following code below; Code: <form name="quick_find_header" action="MYDOMAIN/index.php?main_page=advanced_search_result" method="get"> <input type="hidden" name="main_page" value="advanced_search_result" /> <input type="hidden" name="search_in_description" value="1" /> <select name="keyword"> <option value="1952">1952</option> <option value="1953">1953</option> <option value="1954">1954</option> <option value="1955">1955</option> <option value="1956">1956</option> <option value="1957">1957</option> <option value="1958">1958</option> <option value="1959">1959</option> <option value="1960">1960</option> <option value="1961">1961</option> <option value="1962">1962</option> <option value="1963">1963</option> <option value="1964">1964</option> <option value="1965">1965</option> <option selected value="1966">1966</option> <option value="1967">1967</option> <option value="1968">1968</option> <option value="1969">1969</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> </select> <select name="keyword"> <option value="01">Jan</option> <option value="02">Feb</option> <option value="03">Mar</option> <option value="04">Apr</option> <option value="05">May</option> <option value="06">Jun</option> <option selected value="07">Jul</option> <option value="08">Aug</option> <option value="09">Sep</option> <option value="10">Oct</option> <option value="11">Nov</option> <option value="12">Dec</option> </select> <select name="keyword"> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option selected value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <input type="image" src="includes/templates/theme013/buttons/english/button_search.gif" alt="Search" title=" Search " style="margin-left:1px;" /> </form> this gives me 3 drop down box's (YEAR,MONTH,DAY) The problem is when i click search it only searches for the year. instead of combining all the selected data (e.g. 1996+JUN+23) it just searched for 1996. The second problem is if someone managed to get this form to work, would it search for "1996JUN23" or "1996 JUN 23". The reason i ask this is my products descriptions say "this single was released on 23 June 1996" I hope ive made all the above clear!! Any help would be greatly appreciated. thanks in advance <script type="text/javascript"> function test() { var customer = document.docNameSuggestor.customer.value; var project = document.docNameSuggestor.project.value; var doc_type = document.docNameSuggestor.doc_type.value; var string='<table border="1" cellpadding="1" cellspacing="1"><tr>' + '<td><p>Suggested filename is: ' + customer + '_' + project + '_' + doc_type + '.<extension>' + '</p></td>' + '</tr>' + '<tr>' + '<td><p>Suggested storage path is: ...\\' + customer + '\\' + project + '\\' + doc_type + '</p></td>' + '</tr></table>'; document.getElementById("fileName").innerHTML= string; } </script> <form name="docNameSuggestor" > <td width="60%"> <p>Which customer is this document for?</p> <select name="customer" > <option>Please select</option> <option value="Ci">Ci</option> <option value="VF">VF</option> <option value="H3">H3</option> </select> <td width="60%"> <p>Which project is this document for?</p> <select name="project" > <option>Please select</option> <option value="AX1.0">AX1.0</option> <option value="AXP2.0">AX2.0</option> </select> <td width="60%"> <p>Which type of document is this?</p> <select name="doc_type"> <option>Please select</option> <option value="CRequirements">Requirement Spec</option> <option value="SRequirements">Software Requirement Spec</option> </select> <input type="submit" name="submit" value="Submit" onClick="test()"> <form action="file.html" method="post" target="_blank"></form> </form> These are my codes, Q1.How can I open results in a new window after user submit selected options? Q2:How can I populate the specific field with choices based on what user has selected from customer drop-down Please help. Any suggestions are appreciated. I would like to know how to create a mini form of two pull down boxes so that when the two selections have been made and submitted it returns back a designated page or picture. For example I want to build a simple method to show routes of an office building. Pulldown box 1 would be the office number you want to start from, and pulldown box two would be the office you want to get to. when you click submit it would pull up either a page or picture which contains the corrrect floor plan and route. I feel like this should not be too hard as I don't need anything very flashy. I just don't know how to start it. If anyone knows of something open source already created to do this I would be open to that too. Thanks in advance for any assistence you can give. The tutorial on how to make a search form with multiple search options was excellent! http://www.mediacollege.com/internet...ti-search.html However, is it possible to use radio buttons instead of a drop-down list? Can someone be kind enough to show me the code for it? Million thanks. 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 |