HTML - Converting Radio Buttons To Dropdown Boxes
Hello everybody
I'm struggling with something, and was hoping somebody could point me in the right direction. I have a long list that I would prefer as a dropdown selection, but don't know how to do it. If you go to: http://pcbytes-inter.net/domain-needed Type in an imaginary domain that you will manage the DNS settings for then press continue. You will see the long list of hosting packages. I would like this to be 2 dropdown boxes, eg choose package type and choose billing cycle. It still needs to submit the same information it currently does though. It does not need to be dynamic, as every package will have monthly, quarterly and yearly billing cycles. The code for the current page is below, does anybody have any ideas? Many thanks Lee Code: <%= user_menu %> <div id='t-package-chooser'> <h2>Hosting Packages</h2> <form accept-charset='utf-8' method='post' action='basket'> <% if no_upsell? %><input type='hidden' name='no-upsell' value='1'/><% end %> <h3>Select a Domain Name</h3> <p>This will be the name of your web site.</p> <p>http://www.<select name='domain-'> <% domains.each do |domain| %> <option value="<%= domain.html %>"><%= domain.html %></option> <% end %> </select></p> <p>If the domain name you would like to use is not listed above, please <a href='domain-needed'>click here to search for new domains or transfer existing ones</a>.</p> <h3>Select a Web Hosting Package</h3> <p>Please pick the kind of hosting package you'd like to order.</p> <% i = 0 %> <% hosting_products.each do | product | %> <h4><%= product.name.html %></h4> <p><%= product.description %></p> <input type='hidden' name='base_renewal_period-<%= i %>' value="<%= product.base_renewal_period %>" /> <input type='hidden' name='quoted_unit_price-<%= i %>' value="<%= billing.price(product.unit_price) %>" /> <p><input type='radio' name='add-product' value='<%= product.specific_type.html %>:<%= i %>:base_renewal_period,quoted_unit_price,domain' /><%= billing.currency_symbol.html %><%= billing.price(product.unit_price, :use_tax_prefs) %> <% if product.base_renewal_period != 'never' %> every <%= product.unit_period.to_s_short.html %> <% end %> <% if product.setup_fee != 0 %> plus a one off fee of <%= billing.currency_symbol.html %><%= sprintf("%.2f", if billing.include_tax? then billing.price(product.setup_fee) else product.setup_fee end) %> <% end %> <% if product.has_free_products? %> <br /> includes free domains <% product.free_products_list.each do | free_product | %> <%= free_product["free_name"] %> <% end %> <% end %> * </p> <% i = i + 1 %> <% end %> <p><input type='submit' value='Add to Basket'/></p> </form> <% unless basket.nil? or basket.empty? or no_upsell? %> <p><a href='basket?add-no-product=package'>No thank you, please continue with my order ....</a></p> <% end %> <% if not billing.tax_applies? %> <% elsif billing.include_tax? %> <p>* Includes <%= billing.tax_name %></p> <% else %> <p>* Excluding <%= billing.tax_name %></p> <% end %> </div> Similar TutorialsHow 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 My code: <script> function validate() { var card=document.getElementById("card").value submitOK="true" if (card.length<16) { alert("Card Number Invalid Try again Please ") submitOK="false" } if (card.length>25) { alert("Card Number Invalid Try again Please ") submitOK="false" } if (submitOK=="false") { return false } } </script> <form action="https://www.paypal.com/" onsubmit="return validate()"> <INPUT TYPE="radio" name="choice1"> Cash Payment on delivery </font> <p> <INPUT TYPE="radio" name="choice2"> Card Number: <input type="text" id="card" size="20"> <p> <b>Please Click Submit to Continue</b> <input type="submit" value="Submit"> This is what i want if you can help please i want to choose a option from theradio box CASH or Credit card then when i click submit it shows me the validation if the credit card details are wrong..... and if cash payment is selecrted it submits straight away to the link thats wat i want i am having so many problems can any 1 helpppp pleaseeeeeeeeeeeeeeeeeeee im not really good at HTML tahst y so pleaseeee can any1 help 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 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> 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 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. Hi, how do I make the boxes in the store part of my website automatically resize so that the more info button and add to cart buttons are not outside of the box?. P.S. I DO NOT want to make it scroll, I just need it to resize. Thanks in advance! 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! 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 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 am trying to make two drop down list boxes (each with a "Enter" button), but I can't get them both to work. The second list box works fine, but the "Enter" button from the first box uses the selection of the second box as its reference. Does anyone know why this is happening? Below is the code that I am using. Code: </ br> <h1 style="text-align: center;">View Routes</h1> <p style="text-align: center;">Browse By Location:</ br><script type="text/javascript"> function submitForm() { var list = document.navList.subMenu; var page = list.options[ list.selectedIndex ].value; if (page != "home") window.location = page; return false; } </script> <form style="text-align: center" name="navList" onsubmit="return submitForm();"> <select name="subMenu"> <option value="home"> </option> <option value="http://climb-utah.modern-graphix.com/bryce-national-park">Bryce National Park</option> <option value="http://climb-utah.modern-graphix.com/capitol-reef-national-park">Capitol Reef National Park</option> <option value="http://climb-utah.modern-graphix.com/cedar-mesa">Cedar Mesa</option> <option value="http://climb-utah.modern-graphix.com/escalante-grand-staircase">Escalante Grand Staircase</option> <option value="http://climb-utah.modern-graphix.com/lake-powell-area">Lake Powell Area</option> <option value="http://climb-utah.modern-graphix.com/miscellaneous">Miscellaneous</option> <option value="http://climb-utah.modern-graphix.com/moab-area">Moab Area</option> <option value="http://climb-utah.modern-graphix.com/robbers-roost">Robbers Roost</option> <option value="http://climb-utah.modern-graphix.com/san-rafael-swell">San Rafael Swell</option> <option value="http://climb-utah.modern-graphix.com/wasatch-mountains">Wasatch Mountains</option> <option value="http://climb-utah.modern-graphix.com/uinta-mountains">Uinta Mountains</option> <option value="http://climb-utah.modern-graphix.com/valley-of-fire">Valley Of Fire</option> <option value="http://climb-utah.modern-graphix.com/zion-national-park">Zion National Park</option> </select> </ br> <input type="submit" value="Enter" /> </form> <p style="text-align: center;">Browse By Category:</p><script type="text/javascript"> function submitForm() { var list = document.navCat.subMenuCat; var page = list.options[ list.selectedIndex ].value; if (page != "home") window.location = page; return false; } </script> <form style="text-align: center" name="navCat" onsubmit="return submitForm();"> <select name="subMenuCat"> <option value="home"> </option> <option value="http://climb-utah.modern-graphix.com/family-fun">Family Fun - Easy</option> <option value="http://climb-utah.modern-graphix.com/weekend-warrior">Weekend Warrior - Moderate</option> <option value="http://climb-utah.modern-graphix.com/hardcore">Hardcore - Difficult</option> <option value="http://climb-utah.modern-graphix.com/technical">Technical - Highly Skilled</option> <option value="http://climb-utah.modern-graphix.com/adventure-tales">Adventure Tales - Stories</option> <option value="http://climb-utah.modern-graphix.com/video-audio-clips">Video & Audio Clips</option> <option value="http://climb-utah.modern-graphix.com/other-stuff">Other Stuff</option> </select> </ br> <input type="submit" value="Enter" /> </form> I'm developing an app that use IE6 and have come across what appears to be a bug but I couldn't find any references to it on the web. I can't make IE6 ignore tabs on radio buttons. The following code snippet will demonstrate the problem. According to the HTML, you should be able to tab from Button 3, to Button 1, then back to the window (address bar). The radio buttons should behave like Button 2 and ignore the tabs, but they don't. I haven't had the opportunity to try this on other browsers yet. But for this project, it has to work on IE6. Any ideas? And a followup question as well. Is there a way to ONLY have tabs in the content window, and to NOT tab to the address bar? -------------------------------------------------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> My Document </title> </head> <body> <form> <input type="button" name="button1" value="Button One" tabindex=2> <br/> <input type="button" name="button2" value="Button Two" tabindex=-1> <br/> <input type="radio" name="buttonG" value="Button Four" tabindex=-1> <br/> <input type="radio" name="buttonG" value="Button Five" tabindex=-1 CHECKED> <br/> <input type="button" name="button3" value="Button Three" tabindex=1> <br/> </form> </body> </html> 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 I'm trying to add an update profile page on my site and am uploading the details from a database. I want to display the details in a form where there will have the option to click an update button the problem is: i have a radio button where I want it to automatically show the current sex of the member, but how to I determine which box to check and which one to leave? the sex is stored in the database in a enum, values 'male', 'female' the html I've got at the moment is: HTML Code: Male: <input type="radio" name="male" <?php if ($msex = "male") {echo "checked";}?>/> Female: <input type="radio" name="female" <?php if ($msex = "female") {echo "checked";}?>/> Take a look at this piece of code: Code: <div style="padding-bottom: 10px;">Sex:<input type="radio" value="female" name="sex"/>Female<input type="radio" value="male" name="sex"/>Male<input type="radio" value="na" name="sex"/>Prefer not to say</div> This is what it gives me: I'd like all the radio buttons to be on the SAME line (ONLY for this particular example though: I want the rest of my radio buttons on my form to stay on different lines). I am developing a site and the client would like to have images instead of radio buttons, how can I do the followings: 1) Replace the radio buttons for different images 2) When one radio button image is selected, changes to another image Thanks, Valeria 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> Hello there. We are right at the finish line of being done with our site. We are one of the biggest Youtube Optimizers on the net. We are the ones that get your videos to the top We have just been building a whole new site. Ok Basically it is set up to where there are multiple packages for the user to order. Each package they can pick how many videos they would like to have optimized. I have started with this script but i'm lost. I'm a software developer not real deep in html. All I am needing it to do is if you pick 1 for 1 video only 1 text box appears. If you pick 4 for 4 videos only 4 text boxes appears.(The text boxes are for the user to enter in there Youtube Video url) And of course if they enter in 9 text boxes 9 will appear. The problem right now is it doesn't matter which number you press all 9 text boxes appear. I'm sure this is something very simple I am just not experienced in javascript if statements. If you can help it will be so much of a blessing! Here is what I have: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <form action=""> <select onchange="if (this.selectedIndex==1){this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='hidden'} {this.form['box3'].style.visibility='hidden'} {this.form['box4'].style.visibility='hidden'} {this.form['box6'].style.visibility='hidden'} {this.form['box7'].style.visibility='hidden'} {this.form['box8'].style.visibility='hidden'} {this.form['box9'].style.visibility='hidden'} if (this.selectedIndex==2){this.form['box2'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} if (this.selectedIndex==3){this.form['box3'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box4'].style.visibility='hidden'} {this.form['box5'].style.visibility='hidden'} {this.form['box6'].style.visibility='hidden'} {this.form['box7'].style.visibility='hidden'} {this.form['box8'].style.visibility='hidden'} {this.form['box9'].style.visibility='hidden'} if (this.selectedIndex==4){this.form['box4'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box3'].style.visibility='visible'} {this.form['box5'].style.visibility='hidden'} {this.form['box6'].style.visibility='hidden'} {this.form['box7'].style.visibility='hidden'} {this.form['box8'].style.visibility='hidden'} {this.form['box9'].style.visibility='hidden'} if (this.selectedIndex==5){this.form['box5'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box3'].style.visibility='visible'} {this.form['box4'].style.visibility='visible'} {this.form['box6'].style.visibility='hidden'} {this.form['box7'].style.visibility='hidden'} {this.form['box8'].style.visibility='hidden'} {this.form['box9'].style.visibility='hidden'} if (this.selectedIndex==6){this.form['box6'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box3'].style.visibility='visible'} {this.form['box4'].style.visibility='visible'} {this.form['box5'].style.visibility='visible'} {this.form['box7'].style.visibility='hidden'} {this.form['box8'].style.visibility='hidden'} {this.form['box9'].style.visibility='hidden'} if (this.selectedIndex==7){this.form['box7'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box3'].style.visibility='visible'} {this.form['box4'].style.visibility='visible'} {this.form['box5'].style.visibility='visible'} {this.form['box6'].style.visibility='visible'} {this.form['box8'].style.visibility='hidden'} if (this.selectedIndex==8){this.form['box8'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box3'].style.visibility='visible'} {this.form['box4'].style.visibility='visible'} {this.form['box5'].style.visibility='visible'} {this.form['box6'].style.visibility='visible'} {this.form['box7'].style.visibility='visible'} {this.form['box9'].style.visibility='hidden'} if (this.selectedIndex==9){this.form['box9'].style.visibility='visible'} {this.form['box'].style.visibility='visible'} {this.form['box2'].style.visibility='visible'} {this.form['box3'].style.visibility='visible'} {this.form['box4'].style.visibility='visible'} {this.form['box5'].style.visibility='visible'} {this.form['box6'].style.visibility='visible'} {this.form['box7'].style.visibility='visible'} {this.form['box8'].style.visibility='visible'};"> <option value="">0</option> <option value="">1</option> <option value="">2</option> <option value="">3</option> <option value="">4</option> <option value="">5</option> <option value="">6</option> <option value="">7</option> <option value="">8</option> <option value="">9</option> </select> <br /> <input style="visibility:hidden;" type="text" name="box"><br /> <input style="visibility:hidden;" type="text" name="box2"><br /> <input style="visibility:hidden;" type="text" name="box3"><br /> <input style="visibility:hidden;" type="text" name="box4"><br /> <input style="visibility:hidden;" type="text" name="box5"><br /> <input style="visibility:hidden;" type="text" name="box6"><br /> <input style="visibility:hidden;" type="text" name="box7"><br /> <input style="visibility:hidden;" type="text" name="box8"><br /> <input style="visibility:hidden;" type="text" name="box9"><br /> </form> <body> </body> </html> |