HTML - Multiple Search Options - Radio Buttons Instead Of Drop Down List
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. Similar Tutorialshi 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 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> Hey, I'm trying create a form that contains two radio buttons and a text box and a submit button. Depending on which radio button is selected, a search is done on the keyword. One of the buttons is for a google search and the other is for an internal site I am working with. The problem I am running into is that the 'method' attribute in my form has to equal both "get" and "post", depending on what I select. I've tried a few things using scripts but nothing successful. Any help would be great. Thanks Hi everyone, I'm a total newbie and have zero previous HTML experience (but have experience reading code). I am modifying a site to support 3 radio buttons that switch the function of a single search bar. Could you guys please help me figure this out? Warning - all of this is copy-and-paste frankencode from the source, pieced together by guesswork. It may hurt your eyes. In case you're wondering, this is simply a design prototype for a class I am taking that requires user testing. The actual web development will be done by someone else if accepted. I will learn HTML properly later on. Attached is an image of what I am thinking of. And here is the pertinent code: Code: <h2>Select the search engine that meets your needs.</h2> <form id="form1" name="form1" method="post" action=""> <p> <label> <input name="searchEngineSelection" type="radio" id="searchEngineSelection_0" value="http://uci.worldcat.org/search" checked="checked" /> <strong>Melvyl</strong></label> - Search libraries worldwide for books/music/other media.<br /> <label> <input name="searchEngineSelection" type="radio" id="searchEngineSelection_1" value="http://antpac.lib.uci.edu/search/X?SEARCH=" /> <strong>ANTPAC</strong></label> - Search and reserve material held at UCI Libraries.<br /> <label> <input type="radio" name="searchEngineSelection" value="http://www.lib.uci.edu/search-site.html?cx=009602760963559712792%3Aoglsjsxdz5m&cof=FORID%3A10&ie=UTF-8&q=" id="searchEngineSelection_2" /> <strong>Site</strong></label> - Find a specific page or information on the Library website.<br /> </p> </form> <form accept-charset="UTF-8" action="http://uci.worldcat.org/search" id="wcfw" method="get" name="wcfw" target="_top"> <input name="q" type="text" id="quicksearch_field" /> <input align="top" id="quicksearch_go" onmouseout="goBtnOff()" onmouseover="goBtnOn()" src="./Home Page - UCI Libraries_files/button-go-off.gif" type="image" /> </form> I have no idea how to do it so I am asking you gurus to help. Thanks so much for your time. Hello All, I'm creating a form which has got several parts, divided by tables, which are radio buttons, check boxes etc. All the radio button tables work well with the exception of one where it lets you choose all three options or two, as if they were checkboxes. The code is: PHP Code: <div class="roundedcornrboxorange"> <div class="roundedcornrtoporange"><div></div></div> <div class="roundedcornrcontentorange"> <table width="100%"> <tr> <td colspan="3"><h3>Which level do you think you're currently are?</h3></td> </tr> <tr> <td width="30%"><input type="radio" name="level[beginner]" id="beginner" value="1"/> Beginner</td> <td width="30%"><input type="radio" name="level[intermediate]" id="intermediate" value="1"/> Intermediate</td> <td width="30%"><input type="radio" name="level[advanced]" id="advanced" value="1"/> Advanced</td> </tr> </table> </div> <div class="roundedcornrbottomorange"><div></div></div> </div> Does anyone have an idea what could be going wrong? The css (in case it helps) is: PHP Code: .roundedcornrboxorange { margin: 5px 0 0 0; width: 800px; clear: both; background: #ff7b06 url(../images/roundedcornr190406grad.gif) repeat-x top left; } .roundedcornrtoporange div { background: url(../images/roundedcornr190406tl.gif) no-repeat top left; } .roundedcornrtoporange { background: transparent url(../images/roundedcornr190406tr.gif) no-repeat top right; } .roundedcornrbottomorange div { background: url(../images/roundedcornr190406bl.gif) no-repeat bottom left; } .roundedcornrbottomorange { background: transparent url(../images/roundedcornr190406br.gif) no-repeat bottom right; } .roundedcornrtoporange div, .roundedcornrtoporange, .roundedcornrbottomorange div, .roundedcornrbottomorange { width: 100%; height: 10px; font-size: 1px; } .roundedcornrcontentorange { margin: 0 10px; } Many thanks in advance Hi all, I have a query regarding HTML Radio Buttons. On a site I have created I am use radio button to allow visitors to search fot various files. Below is the code I have used. <input type="radio" name="searchIndex" value="HMD01"/> The "HMD01" is a field in my database. The user types in txt into a textbox and when they click a search button a function checks the "HMD01" field to see if any data matches what was in the textbox and displays the results if there are matches. What I am trying to do is that if the search found no matches in that field that it would search another field in the database to find a match. I thought the code would be something like the code below but that did not work. <input type="radio" name="searchIndex" value="HMD01, PRD03"/> The "PRD03" field contains the same type of information as "HMD01" but is stored in a different table. I want to be able to search "HMD01" for a match then search "PRD03" with the same parameters. Any help would be greatly appreciated. Thanks Towsie So I'd like to have a 160*600 box with hyperlinks displaying only a headlines I select. I would like the bottom of the box to have arrows for navigating between sections of links that fit in the box with a place to enter a page number in between them. I would like it to begin with displaying the most recently posted links starting on the last page number with that being the first page it displays. I want the bottom of the box to include below the browsing chronological browsing feature an arrow facing left with the word "search" that would open a box with a place to type in text for it to search link headlines. At the bottom of the search box I would like an arrow facing down with the words "search by label". Yes, I would like to not only select a headline for each link but also categorically label them. If I could also select images for it to automatically fill the empty space with when a new page number is started that would be great, even better if it selects ones that fill the most depending on how long the headlines are. If it repeated headlines in extra page space instead of showing images that would be cool too. I'd also like it to automatically expand in height past 160*600 to make a new page number just for a headline that doesn't fit in 160*600. I need this in HTML. My blog is episin.blogspot.com 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 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, i just start working on a site, and i have a question. i have 2 radio buttons and a normal button, and i want it to make when i check the first radio button and click on the button it will go to site1.html and if i check the second radio button, and then the normal button it needs to go to site2.html, how do i do that? this is what i have atm: Quote: <form name="form1" method="post" action=""> <p> </p> <FORM name ="form1" method ="post" action ="radioButton.php"> <p> <Input type = 'Radio' Name ='catogorie' value= 'school' > School </p> <p> <Input Name ='catogorie' type = 'Radio' value= 'own' > My Own </p> <P> <Input type = "Submit" Name = "Submit1" VALUE = "Volgende"> i have my list of radio buttons and submit button but what i would like to do is have each one go to a different URL but im having trouble with that at the moment so if anyone could help it would be very appreciated. thankyou Hello there! I'm new to this forum and a definite NEWBIE but am doing my best to learn. I am making a form in which I have several categories that are chosen by clicking on radio buttons. The problem is that I must have coded this incorrectly because you can ONLY click on ONE radio button, even thought there are 7 different subcategories. I'd like to be able to click on one radio button for each of the different subcategories. Any advice would be GREATLY appreciated!!! I have a list of with radio buttons... allowing you to choose from 1-5. It's a HUGE list... so I want to pre select the second (#2) radio button for every question. I used the "checked" command but if I change it to a 1 and save and close, when I go back into it, it defaults back to #2. It is only doing this if I select #1... #3,4,5 stays... how do I fix this? <tr> <td>A-1</td> <td>Question #1</td> <td><input type="radio" name="A1_1" id="A1_1_1" value="1" mapname="A1_1" runat="Server"></td> <td><input type="radio" name="A1_1" id="A1_1_2" value="2" mapname="A1_1" runat="Server" checked></td> <td><input type="radio" name="A1_1" id="A1_1_3" value="3" mapname="A1_1" runat="Server"></td> <td><input type="radio" name="A1_1" id="A1_1_4" value="4" mapname="A1_1" runat="Server"></td> <td><input type="radio" name="A1_1" id="A1_1_5" value="5" mapname="A1_1" runat="Server"></td> </tr> Hi, I am trying to do this: Have 3 Radio Buttons (I think thats what they are called), Like this: 0 0 0 28K 56K Broadband Play (Button) And when you press any of the buttons the right stream is played via a url from another site I have. How to I go about doing this, ? I see aol has similiar feature for downloading files which I liked the look of, pass some time and help me out. I have found these sample html codes but I think these are lacking. I am just a newbie but I know how to trace html codes. <FORM ACTION="../cgi-bin/mycgi.pl"> What size pizza?<P> <INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small<BR> <INPUT TYPE=RADIO NAME="pizzasize" VALUE="M">medium<BR> <INPUT TYPE=RADIO NAME="pizzasize" VALUE="L">large<P> <INPUT TYPE=SUBMIT VALUE="submit"> </FORM> Thanks, Magiclouie Hi All, Using Dreamweaver CS4. I'm creating a form to file webpage for my work. It's just a simple html form that a user can fill out and once they hit submit, the information is saved to a file to be later converted to a spreadsheet or database or whatever. I have several required fields on this form. I was instructed to add a "." after the "Name" of whatever field I am requiring. They all work except my Radio buttons. Regardless if I make a selection (Yes or No) and hit submit, it still says that I need to fill out this field. Here is my code, I have tried several varieties of it, but none seem to work. I am completely new to Html coding so please bear with me. Thank you in advance! <input type="hidden" name="RequireApprovalYesNo." id="RequireApprovalYesNo." value=""> <input type="radio" name="RequireApprovalYesNo." id="RequireApprovalYesNo." value="Yes">Yes <input type="radio" name="RequireApprovalYesNo." id="RequireApprovalYesNo." value="No">No I have also tried (without the "." in the second and third piece of code): <input type="hidden" name="RequireApprovalYesNo." id="RequireApprovalYesNo." value=""> <input type="radio" name="RequireApprovalYesNo" id="RequireApprovalYesNo." value="Yes">Yes <input type="radio" name="RequireApprovalYesNo" id="RequireApprovalYesNo." value="No">No I'm new to the forum and have a question about radio buttons. I think I'm under the right category. I already know how to create the radio buttons and have done that on my site. Where my problem comes in is once a radio button is clicked on. I want to make a trivia page on my site with a multiple choice answers, which means only one answer is correct and the other four options would be wrong. If the correct answer is chosen, I want a page to pop-up or a new page which would let the person know they chose correctly. I also want to do the same for the wrong answers with a pop-up or new page letting the person know they chose wrong if they clicked on any other answer except the correct one. I don't even know if this can be done. I've looked on website help pages and it seems they all differ so I'm getting more confused with each search. Some say to use CSS others say JavaScript. Maybe another way would be better than radio buttons. I'm up for any suggestions. The link to my page for reference is http://wondersofdisney.webs.com/trivia.htm . The page is not visible on my website yet because it is still in construction. If you need any further explanations, please don't hesitate to ask me and I'll try to clear it up. Thanks for any help provided! How to change this table Code: <SELECT id=SelectPeriod style="FONT-SIZE: 11px; WIDTH: 250px; FONT-FAMILY: Tahoma;background:#cccccc;" onfocus="SetVisibility(Find('TrPrice'), 0);" name=SelectPeriod> <OPTION value="" selected dOption="">Избери</OPTION> <OPTION value="1" dOption="100">Да</OPTION> <OPTION value="2" dOption="4">Не</OPTION> </SELECT> to radio buttons Please put an old man out of his mysery I am developing a stand alone 'kiosk' application, it only needs to work in IE 6/7 Why does the page not follow the tabindex order for form radio buttons? It only ever seems to tab between 'checked' buttons - I can not tab to unchecked items. Take a look at http://www.thad.entadsl.com/feedback/feed.php to see what I mean. (ignore layout its a work in progress) Why? Hi there, The following code is called upon the user hitting a submit button and checks that: 1. two drop downs have a response 2. five different groups of radio button each have a response. I have two problems: 1. The first bit of code for the drop downs works, but then seems to ignore the validation code for the radio buttons. 2. The code for the radio buttons repeats five times and each time the only thing that changes is the name of the radio button group (Field23, Field29, etc) and the error message. I cannot seem to find a nice, efficient way of creating a loop that eliminates the clutter I would really appreciate any help with these two problems. Cheers, Adrian Code: <script type="text/javascript" language="JavaScript"> //Ensure that every question is answered, otherwise alert an error function checkAnswers() { var questions = ['Field35', 'Field33']; var errorMessage = ['Please indicate the country where you live.', 'Please indicate your age.']; var i = 0; for (i = 0; i < questions.length; i++) { var response = window.document.getElementById(questions[i]).value; if (response == null || response == "") { alert(errorMessage[i]); return false; } } // set var radio_choice to false var radio_choice = false; // Loop from zero to the one minus the number of radio button selections for (counter = 0; counter < form1.Field23.length; counter++) { // If a radio button has been selected it will return true // (If not it will return false) if (form1.Field23[counter].checked) radio_choice = true; } if (!radio_choice) { // If there were no selections made display an alert box alert("Please select a gender.") return (false); } // set var radio_choice to false var radio_choice = false; // Loop from zero to the one minus the number of radio button selections for (counter = 0; counter < form1.Field29.length; counter++) { // If a radio button has been selected it will return true // (If not it will return false) if (form1.Field29[counter].checked) radio_choice = true; } if (!radio_choice) { // If there were no selections made display an alert box alert("Please indicate your level of education.") return (false); } // set var radio_choice to false var radio_choice = false; // Loop from zero to the one minus the number of radio button selections for (counter = 0; counter < form1.Field27.length; counter++) { // If a radio button has been selected it will return true // (If not it will return false) if (form1.Field27[counter].checked) radio_choice = true; } if (!radio_choice) { // If there were no selections made display an alert box alert("Please indicate your employment status.") return (false); } // set var radio_choice to false var radio_choice = false; // Loop from zero to the one minus the number of radio button selections for (counter = 0; counter < form1.Field25.length; counter++) { // If a radio button has been selected it will return true // (If not it will return false) if (form1.Field25[counter].checked) radio_choice = true; } if (!radio_choice) { // If there were no selections made display an alert box alert("Please indicate your marital status.") return (false); } // set var radio_choice to false var radio_choice = false; // Loop from zero to the one minus the number of radio button selections for (counter = 0; counter < form1.Field31.length; counter++) { // If a radio button has been selected it will return true // (If not it will return false) if (form1.Field31[counter].checked) radio_choice = true; } if (!radio_choice) { // If there were no selections made display an alert box alert("Please indicate your income.") return (false); } return (true); } </script> |