HTML - Radio Button And Hidden Field
I want to be able to use radio buttons on my form but I need the selected one to update 2 seperate fields in my database. I am attaching what I have tried, but didn't work. I am new to all of this, so please be gentle
HTML Code: <INPUT class="element radio" id=element_5_1 type=radio value=Swee****er Golf and CC=Ub2venue> <input type="hidden" name="Ub2bwsdate" value="10/22/2008"/> <LABEL class=choice for=element_5_1>Oct. 22 6:30p.m. Swee****er Golf and Country Club, Apopka </LABEL> <INPUT class="element radio" id=element_5_2 type=radio value=Swee****er Golf and CC=Ub2venue> <input type="hidden" name="Ub2bwsdate" value="10/23/2008"/> <LABEL class=choice for=element_5_2>Oct. 23 2:30p.m. Swee****er Golf and County Club, Apopka </LABEL> <INPUT class="element radio" id=element_5_3 type=radio value=USBank, KC=Ub2venue> <input type="hidden" name="Ub2bwsdate" value="10/28/2008"/> <LABEL class=choice for=element_5_3>Oct. 28 2:30 p.m. USBank, Kansas City </LABEL> <LABEL class=choice for=element_5_4></LABEL> </SPAN> I need it to update field Ub2venue with the locaion and update the Ub2bwsdate field with the date from the selected one. Any help would be appreciated. Similar TutorialsOk so i've recently started html. Moving along, I'm reading a book on xhtml and its talking about hidden fields. Now I get the general idea of what it is used for, but how would it be implemented in a website? or at least can someone give me a better explanation than this one paragraph in this book. Also, I'm seeing foo a lot when talking about the name attribute...it came out of nowhere. Why are they naming stuff foo? Hi all! I'm trying to pass an array as a hidden field from a form in the URL of the browser but it's not working. Can you tell me what is wrong with this...it's my first attempt so be gentle The form HTML is <form name="filter" action="http://www.myurl.com" method="get"> <input type="hidden" name="main_page" value="index" /> <input type="hidden" name="Flt_Grade[]" value="100" /> <select name="filter_id" onchange="this.form.submit()"> <option value="1">Most Popular</option> <option value="2" selected="selected">Price: Low to High</option> <option value="3">Price: High to Low</option> <option value="4">Title</option> <option value="6">Date Added: Newest</option> <option value="7">Date Added: Oldest</option> </select> </form> I would expect, when option 4 in the dropdown is selected the URL to be http://www.myurl.com&main_page=index...00&filter_id=4 Where %5B = [ and %5D = ] But what I actually get is http://www.myurl.com&main_page=index...e=&filter_id=4 The Flt_Grade array is not passed properly. Can this be done so the hidden field is passed in the URL as an array? Thank you! Hiya, I can add a hidden like this to my form... Code: <input type="hidden" name="height" value="197cm" /> But what if I want to change 197cm to 6' 5" - i.e., so it contains apostrophes and speech marks... Code: <input type="hidden" name="height" value="6' 5"" /> doesn't work due to the extra speech mark, so how do I solve? Thanks, James I have a form but a text field and a hidden field don't come in form elements.I am alerting all form elements in a javascript function which is invoked on press of a button and these two form elements don't come. Any idea why that will happen. JS function which alerts the form elements is as follows :- function populateSubmitProfile() { var i =0; alert("Number of forms "+document.forms.length) ; for( i = 0 ; i < document.forms[0].elements.length ; i++) { alert("Name of the elements :"+document.forms[0].elements[i].name) ; } } Apologies in advanced if this has been solved in another forum. I found my answer googling around but i need it refined. One checkbox with two disabled radio buttons. When user clicks on check box it enables both radio buttons and a input text field. Code: <script type="text/javascript"> function enable(x){ if(x.checked){document.formTest.rRegular.disabled=0} else{document.formTest.rRegular.disabled=1}} </script> </head> <body> <form name="formTest" method="POST" action="--WEBBOT-SELF--"> <p><input type="checkbox" name="cbFlower" value="ON" onClick="enable(this)">Flowers</p> <p><input type="radio" checked name="rRegular" value="V1" disabled=1>Regular Package <input type="radio" name="rDeluxe" value="V2" disabled=1>Deluxe Package</p> <p><input type="text" name="tFlower" size="40" disabled=1></p> </form> I'm sure its a simple modification to the 'funciton enable' so that it enables the other radio button and text box. I need to repeat this process for other groups of similiar check boxes with 2 or more radio buttons and a text field. They need to be independent of each other. If this one get's solved I can copy the function and modify it for the other groups. Unless there's a simpler way. Thanks for your help how to create a radio button with border top and left........... Hello Am doing a web page, and I have many radio buttons, when the user selects it, 3 other radio buttons will be selected. any suggestion Hi, i was wondering how do you show certain text such when the mouse is over the radio button. I tried <input type="radio" value="test" name="test" alt="mouse over radio"> test but the word "mouse over radio" does not pop, anyone have any idea? Thanks in advance. Does anyone know how to make the radio button transparent? I need to put a radio button on a textured background but I don't want the rectangle and actual button to show up on top of the background. I wanna the image working as a radio button. Thanks in advance! Hey guys. Is it possible to assign a value to a radio button such as a large section of text which I have an id to. So for instance my text is <font id="someText">Words</font> I want my radio button value to correspond with that. Anyone have any ideas? -Tim 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 Does someone(s) know how to make a 'radio' button invisible but leave the associated text and VALUE? Thank you! hi. i have 5 radio buttons which disable when one on which is selected! but i cant post the value to the next page! how can i understand which on one is selected?! Thank you all 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. Hi All, I want to retrieve the value of checked radio button ? I have two radio button. Clicking on any radio button it should retrieve the value of particular checked radio button. please reply soon. Thanks How do I place a label for a radio button above the radio button? Hi all, I would like to ask for your help here. How can I first have a few radio buttons on my page and when the user select one of those, a text box with a submit button will appear. The text box is for the user to key in some kind of code/password so that it will prompt the user to a url according to the code/password. Example: Code: YAH URL: www.yahoo.com Code: GOO URL: www.google.com And if the user keys the wrong code it will prompt a message box asking them to try again. If the user key the code wrongly for 3 times it will prompt to another url. Ive also attach an example of how it should look like. I would appreciate for your help. Thanks a lot! Here is my code: 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" dir="ltr" lang="en"> <head> <title>Prospective Student Database</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> </head> <body> <form action="insert.php" method="post"> <input type="radio" name="gender" value="1">Male </form> </body> </html> I am trying to follow the W3C standard, which I put in the W3C HTML validator. It keeps giving me a error of the radio button should end with '/>' instead of '>'. Like this: Code: <input type="radio" name="gender" value="1"/>Male But I checked the W3C recommendation. Even their recommendation on the radio button doesn't end with '/>' The recommendation is he http://www.w3.org/TR/html4/interact/forms.html The first example already showed. What is the problem? Thanks. On as in pre-selected when a page loads... 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 |