HTML - Setting Initially Selected On A Radio Group Within A Form
So I have a radio group within a form. Specifically, here is my code:
HTML Code: <table> <tr> <td><label> <input type="radio" name="question_1" value="Average" id="question_1_0" /> Average</label></td> <td><label> <input type="radio" name="question_1" value="Large" id="question_1_1" /> Large</label></td> <td><label> <input type="radio" name="question_1" value="Gigantic" id="question_1_2" /> Gigantic!</label></td> <td><label> <input type="radio" name="question_1" value="Getting_larger" id="question_1_3" /> It's Getting Larger...</label></td> </tr> </table> So I need to set an initially selected on this radio group. How do I do that? Thanks! Similar TutorialsHi I have a web form that, on submission populates a mySQL database through PHP. Each question on the form can have up to 5 different answers. What I am trying to achieve, either through radio groups or drop-down menus is to have unique values for each number so effectively ranking them. Example: Rank your favourite colours from these: Red [1][2][3][4][5] Blue [1][2][3][4][5] Green [1][2][3][4][5] White [1][2][3][4][5] Orange [1][2][3][4][5] Now for each one, I only want the user to select a UNIQUE value so that the same two numbers cannot be submitted. On submission there must be a 1,2,3,4 & 5 (ie with no two questions having the same number) Scratching my head on this one. Any help would be most welcome. Thanks Hey guys. I've been using local storage for my form and so far it's worked great. Most of the form is simply having the user type in an answer but I have 4 questions that need to be as radio buttons. The problem is I need these radio buttons to be calculative values. I'm pretty sure I've got the 'setting values' part down but how do I 'set item' and 'get item' using local storage? Thanks in advance! Here's what I'm using: HTML Code: <input type="radio" name="length" value=".106" /> Less than 1 year<br /> <input type="radio" name="length" value="0" /> 1-2 years<br /> <input type="radio" name="length" value="-.053" /> More than 2 years<br /> HTML Code: localStorage.setItem("length", this.elements["length"].value); HTML Code: localStorage.getItem("length") 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. 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 I am making a page with a load of thumbnails which are links to other pages. The code is essentially... Code: <a href="#"> <img src="thumbnail" /> <span> <img src="larger image with some nice css styling" /> </span> </a> a span has display none and and a:hover span has display block. What I want to know is does the larger image load with the whole page or does it only load when you hover on the link. I.E. does having loads of hidden images effect page load time? Thanks Wondering if anyone can help me out or point me in the right direction... I am looking at setting up a radio form that will populate with mandatory fields that must be filled out before sending it off. I am restricted to using HTML only and maybe some JavaScript.. I have attached my idea in image on this post and could really use some assistance in finding a solution for this Hello everybody, maybe someone can help me with a problem on my site. There is a form on the page where the user can select images from a dropdown list, it looks like this: Code: <FORM NAME="form"> <SELECT NAME="selbox" SIZE="1" ONCHANGE="imgchange()"> <OPTION VALUE="cards/gifs/deck1">Essential</OPTION> <OPTION VALUE="cards/gifs/fool">0</OPTION> <OPTION VALUE="cards/gifs/magician">I</OPTION> <OPTION VALUE="cards/gifs/priestress">II</OPTION> <OPTION VALUE="cards/gifs/empress">III</OPTION> </SELECT> </FORM> </TD> <TD VALIGN="TOP" ALIGN="CENTER"><BR> <FORM NAME="frm"> <INPUT TYPE="text" SIZE="18" NAME="indate"><P><INPUT TYPE="button" VALUE="show me" ONCLICK="getcard()"></P> </FORM> Now I would like to put a link on each image when it is shown on the page, so that the user can click on it and get the 'explanation window'. How should I write the links when the url should load in a popup window? The link for one image would look like this: Code: <A HREF='javascript:cards("cards/fool.html")' ONFOCUS="this.blur();">xxx</A> Right now I do not even manage to open a link in the same window, let alone in a pop up.. Any help would be greatly appreciated, thanks for reading! Yatkha I have created a button which is linked to some JavaScript to dim the screen when it is pressed. using CSS I have changed the image of the button using a graphic. The graphic is a .PNG as it uses transparency but when set the image as the button it has lost all transparency is there anyway to enable the transparency of the .PNG this is the code I am using to do it. Code: <input type="button" onClick="d()" class="button"> i have a form that returns the user upon a number of errors (of course) - i'm able to retain the text input data (value="<?php echo $_POST['em_name'] ?>") upon return, but i don't know how to retain the radio button or checkbox data so that they don't have to recheck it if necessary. it's in html/php... can someone help? much appreciated... GN In my HTML page, I have two forms. Form 1: Radio Button A, Radio Button B, Radio Button C Form 2: Radio Button D, Radio Button E, Radio Button F. Form 2 Radio Button are disabled. If I click on A, D will be the only button enabled, if I click on B, E will be the only button enabled, if I click on C, F will be the only button enabled. However, when I click on one of the Radio Buttons of Form 1, if I am using the Internet Explorer (version 6), the radio buttons in Form 2 are still disabled. It is not until I click on somewhere else that the proper button will be enabled. So, if I click on A, nothing will be enabled. After I click somewhere else, only after that D is enabled. Worse, if I click B, nothing happens and when I click C next, E will be the one enabled (but when I click on somewhere else, F will be enabled). This only happens in Internet Explorer. It works fine with Mozilla Firefox. I'd like to know if there's a solution to this if I am using the Internet Explorer. Here's a sample of my code: <form name="form1"> <input id="ButtonA" type="radio" name="radiobutton" value="valueA" onChange="document.form2.d.disabled=false;document.form2.e.disabled=true;document.form2.f.disabled=t rue;"> <input id="ButtonB" type="radio" name="radiobutton" value="valueB" onChange="document.form2.d.disabled=true;document.form2.e.disabled=false;document.form2.f.disabled=t rue;"> <input id="ButtonC" type="radio" name="radiobutton" value="valueC" onChange="document.form2.d.disabled=true;document.form2.e.disabled=true;document.form2.f.disabled=fa lse;"> </form> <form name="form2"> <input id="ButtonD" id="d" type="radio" name="radiobutton" value="valueD" disabled=true> <input id="ButtonE" id="e" type="radio" name="radiobutton" value="valueE" disabled=true> <input id="ButtonF" id="f" type="radio" name="radiobutton" value="valueF" disabled=true> </form> Please kindly help. Thank you. Best regards, ChrisX I have a form with radio buttons. I want it so that only one is selectable at a time and if radiobutton 1 is selected then whenever another radiobutton is selected radiobutton 1 will be deselected. Here is the code: HTML Code: <html> <head> <title> </title> <script src="script.js"> </script> </head> <body> <form> <input type="radio" id="hbEgg" value="hb"> <label for="hb"> Hard Boiled Egg </label> <br /> <input type="radio" id="mbEgg"> <label for="mb"> Medium Boiled Egg </label> <br /> <input type="radio" id="fbEgg" value="fb"> <label for="fb"> Full Boiled Egg </label> <br /> <input type="radio" id="ebEgg"> <label for="eb"> Extra Boiled Egg </label> <br /> </form> </body> </html> Thanks in advance. Hello. I was wondering if it's at all possible to have a specific checkbox or radio button checked/selected when the user gets to that page depending on the link they clicked to get to that page. For example, I have a client who wants the user to go to a single form but from different categories (rather than having a form for each), but to make sure the recipient of the email knows which category it came from, the checkbox for that category would already be checked. The user would be able to check it themselves as well, but this ensures it's already selected and creates convenience for the user. Thanks 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 want to change the form action clicking on radio button. I have two radio button. the default action is a1.jsp if I click on update button If I click on second radio button I want to change the form action. I want to redirect to another file (change form action if possible) if I click on second radio button How can I do that ? Thanks please reply soon. 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> Hi All, I want to change the form action clicking on radio button. I have two radio button. the default action is a1.jsp if I click on update button If I click on second radio button I want to change the form action. I want to redirect to another file (change form action if possible) if I click on second radio button How can I do that ? Thanks please reply soon. Hi all. I have a page that the select box is not selecting the option when selected is put in there. Here is the code. Any help you have is appreciated =) Thank you =) Light and Love and Healing to you, -Patrick Arden McNally Code: <html> <head> <title>DULUTH Music Scene</title> <link rel="stylesheet" type="text/css" href="music_scene.css"> </head> <body > <div class="wrapper"> <table width="100%"> <tr><td colspan="2"> <table width="100%" border="1"> <tr width="100%" align="center" valign="top"> <td><a href="index.php">Home</a></td><td><a href="calendar.php">Calendar</a></td><td><a href="featured.php">Featured Shows</a></td> <td><a href="view.php?mode=3">Venues</a></td><td><a href="view.php?mode=2">Local Artists</a></td><td> <a href="classifieds.php?type=1">Instruments</a><br> <a href="classifieds.php?type=2">Lessons</a><br> <a href="classifieds.php?type=3">Repairs</a><br> </td> <td><a href="email.php">Contact<br><a href="about.php">About Us</a><br><a href="user_reg.php">Join</a></td></tr> </table> </td></tr> <tr> <td><h2> DULUTH<br>Music Scene</h2> </td><td align="right"> You are logged in (admin) <a href="logout.php">logout</a><br> <a href="home.php">My Profile</a> | <a href="admin.php">MusicScene Admin </a></td></tr> <tr><td colspan="2"> <hr> <h2>Edit Featured Show</h2> <form action="admin.php?mode=edit_featured" method="post" name="form1" enctype="multipart/form-data"> <input type="hidden" name="mode" value="edit_featured"> <input type="hidden" name="id" value="9"> <input type="hidden" name="regionID" value="1"> Shows: <select name="showID"><option value="27" selected>2009-04-25 - The Rez <br>The Big Wu - The Orpheum Duluth - NorShor Theatre 1st Floor</option><option value="33" >2009-06-25 - The Infinite Flow <br>The Lovers - Blue Crab</option><option value="8" >2009-07-10 - The Infinite Flow <br> Johnny Reeferseed & the High Rollers<br> Harmonic Order<br> Cirrus Minor<br> The Rez<br> Dead L - Mellow Meddle Music Festival</option><option value="10" >2009-07-10 - The Rez <br>The Infinite Flow<br> Harmonic Order - Mellow Meddle Music Festival</option><option value="15" >2009-07-10 - The Infinite Flow <br>The Rez - Mellow Meddle Music Festival</option><option value="29" >2010-10-20 - The Hobo Newphews of Uncle Frank <br>JnvsVwNotS - The Rex</option></select><br> Description: <textarea name="description" cols="80" rows="10">The Rez and The Histronic will be opening for The Big Wu on Saturday April 25th at the Historic NorShor Theatre in Duluth (Now Called The Orpheum Duluth).</textarea><br> User: <select name="userID"> <option value="16" >Jamie Ness</option> <option value="17" >Jim Hall</option> <option value="18" >Marc Gartman</option> <option value="19" >Too Many Banjos</option> <option value="20" >Acceleratii</option> <option value="21" >Root City Band</option> <option value="22" >The Tisdales</option> <option value="23" >Equal Xchange</option> <option value="24" >Charlie Parr</option> <option value="25" >Uprising</option> <option value="26" >The Fractals</option> <option value="27" >Lonesome Dan Kase</option> <option value="28" >Ian Alexy</option> <option value="29" >The Hobo Newphews of Uncle Frank</option> <option value="30" >The Hobo Newphews of Uncle Frank</option> <option value="45" >Thirsty Pagan Brewing</option> <option value="46" >Lakeview Castle</option> <option value="48" >The Orpheum Duluth - NorShor Theatre 1st Floor</option> <option value="49" >The Rex</option> <option value="60" >Sir Benedict's Tavern on the Lake</option> <option value="61" >Pizza Luce</option> <option value="62" >Blue Crab</option> <option value="63" >Fitger's Brewhouse</option> <option value="51" >#dennick[IRIFIFZFZIII]</option> <option value="52" >2</option> <option value="12" >Music Scene Admin</option> <option value="47" >Angelic Ascension</option> <option value="13" >The Infinite Flow</option> <option value="58" >infoffwrofE</option> <option value="59" >itedgeGootorm</option> <option value="55" >Josh Brown</option> <option value="56" >pp</option> <option value="57" >pp</option> <option value="42" >Patrick</option> <option value="43" >Patrick</option> <option value="44" >Patrick Arden McNally</option> <option value="8" >Patrick Arden McNally</option> <option value="9" >Patrick Arden McNally</option> <option value="15" >Teague Alexy</option> <option value="14" >The Beat Coffee House</option> <option value="31" selected>The Rez</option> <option value="2" >Tim and Pat</option> <option value="6" >Twins Bar</option> <option value="50" >xpokvmihdsz</option> </select><br> Date Start: <select name="date_start_month"><option value="01" >Jan</option><option value="02" >Feb</option><option value="03" >Mar</option><option value="04" selected>Apr</option><option value="05" >May</option><option value="06" >Jun</option><option 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="date_start_day"> <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 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" selected>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> <select name="date_start_year"><option value="2009" selected>2009</option><option value="2010" >2010</option><option value="2011" >2011</option><option value="2012" >2012</option><option value="2013" >2013</option></select><br> Date End: <select name="date_end_month"><option value="01" >Jan</option><option value="02" >Feb</option><option value="03" >Mar</option><option value="04" selected>Apr</option><option value="05" >May</option><option value="06" >Jun</option><option 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="date_end_day"> <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 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" selected>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> <select name="date_end_year"><option value="2009" selected>2009</option><option value="2010" >2010</option><option value="2011" >2011</option><option value="2012" >2012</option><option value="2013" >2013</option></select><br> Paid: <input type="checkbox" name="paid" checked> Payment ID: <input type="text" name="payment_id" value=""><br> Active: <input type="checkbox" name="active" checked><br> Type: Front Page <input type="radio" name="featured_type" value="1" checked> | Featured Shows Page <input type="radio" name="featured_type" value="2" ><br> Featured photo: <input type="file" name="featured_photo"><br> <input type="hidden" name="featured_photo_old" value=""> <input type="submit" name="submit" value="Submit"> </form> <br><hr><br><br><br> <a href="admin.php?mode=featured">Add/Edit Featured Shows</a> | <a href="admin.php?mode=banners">Add/Edit Banners</a> | <a href="admin.php?mode=classifieds">Add/Edit Classifieds</a> | <a href="admin.php?mode=report">View Site Reports</a> <tr><td colspan="2" align="center"> <br><br> </td></tr> </table> </div><div class="push"> <div class="footer"><a href="about.php">About us</a> | <a href="email.php">Contact Us</a><br> <div style="font-size: 12px;">Website Design by <A href="http://www.thedesignedge.com/">The Design Edge</a> - ©2009 Music-Scene.org</div></div> </body></html> My apologies if this belongs in a different forum. I'm creating an order form for a site and I need to add something I've never done before. I want content to be added to the form if the user clicks on a certain radio button. At the bottom of the form there are fields for the subtotal and total of the items that they're inputting at the top of the form. By clicking on a radio button I want to do either of the following. 1) A new table cell appears with text and an input field that has a number already in it. 2) The above cell and content are already on the page, and the clicking of the radio button only adds the info into the empty input. The first option I assume is a little more complicated and probably deals with CSS and/or Javascript. Option 1 is preferred but if I can only do number 2 then I'll deal. Just a note, I'm not doing any actual number calculations with this form. It's just raw numbers so there's no need to take that into consideration. Any and all help will be greatly appreciated. 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!! |