HTML - Radio Buttons
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
Similar TutorialsI 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> 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!!! 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"> 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. 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? 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 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! 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> 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> 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 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). 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 have a group of radio buttons generated dynamically and i want to disable user changing his choice after selecting one! i want to disable the group of radios or lock the first choice somehow! apologize me for my poor eng! tanx 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 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> Hope someone can help me. I've got a html page set up so that my clients can type in their name, choose several options via radio buttons, an option to clear the form, then submit the form. What I'm having trouble with is how to obtain the information from the form. I think I would prefer this to be retrieved via email. Is there a way I can: 1. Have the subject of the email be the name of the client (whatever they type in) 2. The results of the form sent to my email (let's say it's myemail@university.edu) Thanks in advance! Here is the html code I have: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Bonus</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form method = "post" action = "mailto:myemail@university.edu"> <p> Type your name in the box below then select the advancing team and click <i>submit</i> when finished. </p> <p> Name: <input type = "text" name = "name" maxlength = "30"/> </p> <table border = "5"> <tr> <td colspan = "2" align = "center"><b>STANLEY CUP PLAYOFF HUNT BRACKET</b></td> </tr> <tr> <td width="328" align = "center">Eastern Conference</td> <td width="359" align = "center">Western Conference</td> </tr> <tr> <td><input type = "radio" name = "group1" value = "BB"/>Boston Bruins (1) <input type = "radio" name = "group1" value = "MC"/>Montreal Canadiens (8)</td> <td><input type = "radio" name = "group2" value = "SJS"/>San Jose Sharks(1) <i>vs.</i> <input type = "radio" name = "group2" value = "AD"/>Anaheim Ducks (8)</td> </tr> <tr> <td><input type = "radio" name = "group3" value = "WC"/>Washington Capitals (2)<input type = "radio" name = "group3" value = "NYR"/>New York Rangers (7)</td> <td><input type = "radio" name = "group4" value = "DRW"/>Detroit Red Wings (2) <i>vs.</i><input type = "radio" name = "group4" value = "CBJ"/>Columbus Blue Jackets (7)</td> </tr> <tr> <td><input type = "radio" name = "group5" value = "NJD"/>New Jersey Devils (3) <input type = "radio" name = "group5" value = "CH"/>Carolina Hurricans (6)</td> <td><input type = "radio" name = "group6" value = "VC"/>Vancouver Canucks(3) <i>vs.</i><input type = "radio" name = "group6" value = "SLB"/>St. Louis Blues(6)</td> </tr> <tr> <td><input type = "radio" name = "group7" value = "PP"/>Pittsburgh Penguins (4) <input type = "radio" name = "group7" value = "PF"/>Philadelphia Flyers (5)</td> <td><input type = "radio" name = "group8" value = "CB"/>Chicago Blackhawks (4) <i>vs.</i><input type = "radio" name = "group8" value = "CF"/>Calgary Flames (5)</td> </tr> </table> <p></p> <p><input type = "reset" value = "Reset"/> <input type = "submit" value = "Submit" /></p> </form> </body> </html> In a form, how do I define a radiobutton so that when it is selected additional form fields ara loaded onto the same page holding the text in other fields? I am using Frontpage 2003 to build my site. |