JavaScript - Retaining Input In Web Form
this is my javascript used to validate form.having problem when one selection is made and submit button is clicked.the checked button becomes unchecked.
i've to check all the radio button in order to proceed with submission. here is the code...anyone pls help how to solve this..tq <script type = "text/javascript"> function validate_form ( ) { valid = true; if ( ( document.myform.gender[0].checked == false ) && ( document.myform.gender[1].checked == false ) ) { alert ( "Please choose your Gender: Male or Female" ); gender.focus(); valid = false; } if ( ( document.myform.nationality[0].checked == false ) && ( document.myform.nationality[1].checked == false ) ) { alert ( "Please choose your Nationality" ); nationality.focus(); valid = false; } if ( document.myform.age.selectedIndex == 0 ) { alert ( "Please select your Age." ); age.focus(); valid = false; } return valid; } </script> Similar TutorialsHelloo Im new to javascript.. I need help badly... here are two tabless. 1. information of a friend. 2nd table i get when i click da image (ADD ANOTHER FRIEND) but, on validation and submission.. the second table is not showing upp... When i once click ADD FRIEND.. i want the table to show up on reload and validation.... Thanks Here is my code <? if (isset($_POST['submit'])) { if (!$frndname) { $frndname_error = 1; $problems=1; } if (!$frndcity) { $frndcity_error = 1; $problems=1; } ///doo db stuff insertion } ?> <!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> <script type="text/javascript"> function showTable() { var table = document.getElementById("myTable"); if (table) table.style.display = "block"; var div = document.getElementById("frndimg"); if(div) div.style.display = "none"; } </script> </head> <body> <form action="" method="POST" name="form1"> <?php if(!isset($_POST['submit']) or $problems) { ?> <table> <tr> <td colspan="2"> <table width="21%"> <tr> <td width="3%" align="left" valign="top"> </td> <td colspan="2"> <b class="referralheading"> YOUR FRIEND'S INFORMATION: </b> </td></tr> <tr> <td width="3%" align="left" valign="top"> </td> <td width="16%"><? if ($frndname_error) { echo ("<font color='#FF0000'>Name:</font>"); } else { echo ("Name:"); }?> <b><font color="#FF0000">*</font></b><br> <input type="text" name="frndname" id ="frndname" value="<?php echo $frndname; ?>" maxlength=45 size=25></td> <td width="81%" colspan="3">City: <b><font color="#FF0000">*</font></b><br><input type="text" id="frndcity" name="frndcity" value="<?php echo $frndcity; ?>" maxlength=45 size=25> </td> </tr> </table></td></tr> <tr> <td width="4%" align="left" valign="top"> </td> <td > <div style="float:left;cursorointer;"> <img src="images/referral_add_friend.jpg" width="190" height="28" onClick="showTable()" title="Click to add another friend" id="frndimg"> </div> </td></tr> <tr> <td colspan="2"> <table width="100%" id="myTable" style="display:none;"> <tr> <td width="4%" align="left" valign="top"> </td> <td colspan="2"> <b class="referralheading"> YOUR FRIEND'S INFORMATION: </b> </td></tr> <tr> <td width="4%" align="left" valign="top"> </td> <td width="53%"> NAme: <b><font color="#FF0000">*</font></b><br> <input type="text" name="frnd1name" id ="frnd1name" value="<?php echo $frnd1name; ?>" maxlength=45 size=25></td> <td width="47%" colspan="3">City: <b></b><br><input type="text" id="frnd1city" name="frnd1city" value="<?php echo $frnd1city; ?>" maxlength=45 size=25> </td> </tr> <tr> <td width="4%" align="left" valign="top"> </td> <td>Phone Number: <b></b><br> <input type="text" name="frnd1phone" id ="frnd1phone" value="<?php echo $frnd1phone; ?>" maxlength=45 size=25></td> <td colspan="3">Email: <br><input type="text" id="frnd1email" name="frnd1email" value="<?php echo $frnd1email; ?>" maxlength=45 size=25> </td> </tr> <tr><td> </td></tr> </table> </td></tr> <tr> <td><input type="image" src="images/submit_referral.jpg" height="30" width="173" border="0" alt="Submit Form" value="submit"></td></tr> <tr><td> </td><td align="center" class="referralheading"> Fields Marked With * Are Required</td></tr> </table> <? } ?> </form> </body> </html> I am thinking this should be fairly easy but yet I am not getting far. I want to have a form with a single text imput field for a zip code. Depending on which zip code the user enters will determine which url they will be sent to. If they enter a zip code which is not in the script, they would be sent to a default url. I am also assuming this can be accomplished with javascript. Any help is greatly appreciated. Hi, i want to set an input value to the same value as the input selected from another input on the same form so when the user selects input 1 i want the hidden input2 to get the same value im guessing i use onsubmit because its hidden so there wont be a focus or blur this would be part of the input Code: onsubmit="(this.value = this.othervalue)" othervalue being the other input name="othervalue" is that the correct syntax Hi there Im trying to create a function where i pass two element id's and my script populates it with events and anything else it may need to run but what i am finding is that i cant use this so that the instance of the object is kept what ends up happening is nothing at all what i would like to have happen is the code to work somthing like this... Code: <div id="iAmTheTargetId"> </div> <div id="iWillHoverOverYouId"> </div> <script type="text/javascript"> var element = new hoverBox('iAmTheTargetId','iWillHoverOverYouId'); </script> and simply running that would then create the equivalent of doing Code: <div id="iAmTheTargetId" onmouseover="element.activate()" onmouseout="element.deactivate()" onmousemove="element.update(event)> </div> <div id="iWillHoverOverYouId"> </div> <script type="text/javascript"> var element = new hoverBox('iAmTheTargetId','iWillHoverOverYouId'); </script> But of course the code above won't actual add onmouseover and etc it just so you can see what i'm trying to achieve Code: /* * triggerId * the element in which the attributes will be applied to * * hoverBoxid * the element in which will hover around the triggerId */ function hoverBox(triggerId,hoverBoxid){ this.triggerElement = document.getElementById(triggerId); this.hoverBoxElement = document.getElementById(hoverBoxid); if(this.triggerElement == null || this.hoverBoxElement){ return null; } self = this; alert(this.triggerElement); this.triggerElement.addEventListener('mouseover',function(){self.activate();},false); this.triggerElement.addEventListener('mouseout',function(){self.deactivate();},false); this.triggerElement.addEventListener('mousemove',function(){self.update(event);},false); } hoverBox.prototype = { triggerElement : null, hoverBoxElement : null, state : false }; hoverBox.prototype.activate = function(){ this.state = true; }; hoverBox.prototype.deactivate = function(){ if(this.state != false){ this.hoverBoxElement.style.display = "none"; this.state = false; } }; hoverBox.prototype.update = function(evt){ if(this.state != false){ this.hoverBoxElement.style.display = "block"; this.hoverBoxElement.style.position = "absolute"; this.hoverBoxElement.style.top = (evt.clientY + 5)+ "px"; this.hoverBoxElement.style.left = (evt.clientX + 10)+ "px"; } }; A quick note theses function will work by them selfs if you just do Code: <div id="target" onmouseover="aHoverBox.activate()" onmouseout="aHoverBox.deactivate()" onmousemove="aHoverBox.update(event)"> </div> <div id="hover"> </div> <script type="text/javascript"> var aHoverBox = new hoverBox('iAmTheTargetId','iWillHoverOverYouId'); </script> But not quite what I'm after i would like not to have to enter in Code: onmouseover="aHoverBox.activate()" onmouseout="aHoverBox.deactivate()" onmousemove="aHoverBox.update(event)" and have that done by the JavaScript Well i hope every thing makes scene sorry if i repeated my self just making sure you understand me Hey guys, have a bit of an issue/question... Not sure what I am doing wrong...i do not know javascript at all lol I have a URL stucture which needs to be changed according to the input fields https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer-jcode-USA-P4038P0122&adminflag=Y This part stays the same at all times https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId= after the "=" sign, I want it to input text from a input box "J-JOE123", so if I put J-DOE123 in the first input box and run the search, I want it to pull up https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId= J-DOE123 after the "J-DOE123", the next part "&vgroupName1=Dealer-" remains the same at all times https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123 &vgroupName1=Dealer- the next input box would have a drop down with 2 selections (jcode and lcode) so depending on which one is chosen, that is how it would populate the URL https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer- jcode next, i would need for it to put a "-" after the chosen jcode or lcode in the URL, which will also be there at all times https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer-jcode - the next input box would have a drop down with 2 selections (USA or CAN) so depending on which one is chosen, that is how it would populate the URL https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer-jcode- USA next, i would need for it to put a "-" after the chosen jcode or lcode in the URL, which will also be there at all times https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer-jcode-USA - next, i will have a drop down box containing several hundred codes such as "P0122" and many more. for this, I would need for the display value to be "P0122" but when the URL gets populated, it would have to be "P4038P0122" https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer-jcode-USA- P4038P0122 The reason why the entire code must change is because P0122 would be P4038P0122, but if it is P0165, it would be N1534P0165, so each code would have its own first part and second part, but in the drop down box, i want it to only display the 2nd part P0122/P0165/etc.. because that is what I go by, but the system only reads full codes. I do have a spreadsheet with the entire list of FULL codes and can do an extract from each cell in order to get the SHORT code. and finally, the URL would have to end with "&adminflag=Y" and will remain the same at all times. https://sls.example.com/Spc/viewUserProfile.do?source=search&UserId=J-DOE123&vgroupName1=Dealer-jcode-USA-P4038P0122 &adminflag=Y So, all together I would have 4 input fields in the form. UserID, jcode/lcode, USA/CAN, and Code. Please help who ever can. If you need more info, please let me know and I shall try my best to explain further. Thanks in advance guys Not sure how to describe this. I've been tasked with the responsibility of creating a web form. That's not the problem and I can do that. The trick is, each field needs to be incased in it's own box that flies in from the left. So, the first box that flies in from the left would be email address, when you click enter, it flies off to the right and the next box flies in from the left asking for the persons name. Is it possible to do this and where might I go to learn more about doing this type of coding. Hi, I've devised a javascript to guess what a user is typing in. That all works, but I'm stuck on how to take that value the user has submitted and put it back into the form. At the moment my form is: <form method="post" action="/bin/openathenssp_isapi.dll?type=ukfed&dir=req&requestURL=index.php" onsubmit="send_sso('login_form', 'loading', '<?=SITE_URL?>'); return false;"> <input type='text' name='uni_name' id='uni_name' value='' autocomplete="off"> <input type="hidden" name="entityID" id="entityID" /> //Where the name is guessed <script>actb(document.getElementById("uni_name"),customarray);</script> <input type='submit' name='submit' value='submit'> </form> So basically I'm trying to put uni_name into the entityID. Here's my javascript: function send_sso(ajax_div, loading_div, site_url) { replace_this_div = ajax_div; replace_loading_div = loading_div; var entityID = document.getElementById("entityID").value; if (uni_name == "Bournemouth University"){ document.getElementById('entityID').value = "https://idp.bournemouth.ac.uk/shibboleth"; ...MORE INSTITUTIONS GO HERE... } else { alert("Sorry, the institution '" +uni_name+ "' was not recognised or does not have access to this service."); } } But this does not seem to be working - any ideas? Allright, so i got index html, and on the head of the document i got jquery already, and what i got is a form, and what i want it to do is that once the input is sumbmited, to post it on a list. BUt something is missing here or maybe im doing it wrong, i need some guidance plz. here is my table: Code: <form name="postbar_add_post" id="postbar_add_post" method="post"> <fieldset> <legend>Write text here ...</legend> <input type="text" name="addcontentbox" id="addcontentbox" /> <input type="button" name="addpost" value="Submit" class="submit" /> </fieldset> </form> and heres is the function that i have on the head, where what i try is to make it post on the list: Code: <script type="text/javascript"> $(document).ready(function(){ $("form#postbar_add_post").submit(function() { var message_wall = $('#addcontentbox').attr('value'); $.ajax({ type: "POST", data:"addcontentbox="+ addcontentbox, success: function(){ $("ul#wall").prepend("<li>"+addcontentbox+"</li>"); $("ul#wall li:first").fadeIn(); } }); return false; }); }); </script> But is just not working :S .... any ideas/guidance? xD . Btw, on the body, theres only that table above, and a " <ul id="wall"></ul> " , wich is where im trying the content to be posted on. Any ideas where the flaw is ? =\ Using .htaccess i have a password protected folder online containing 7 files with one single user/pass combination. User is not allowed to see that 7 files are available. User enters 1 of 7 "Access Keys" in a simple HTML Form text input which is then processed (script?) User is then redirected automatically to the related file (for download) e.g. Access Key #1 redirects user to Protected File #1 Access Key #4 redirects user to Protected File #4 etc. What's the best way to implement this? Perl/CGI? PHP? Javascript? Hi, I have a registration form with the following input field: textbox -name textbox -surname textbox -phone listbox - country listbox - state Am populating my country & state listbox from my database, state depends on the country. However when i select my country&state the page refreshes & all my other values i.e name, surname, phone & others disappears i have to retype all again, any suggestion? thanks Hi everyone, im new to javascript and I have created two forms.. a value will be put in the first field and the second field should display either $20 or $35 depending on the value of the first field. Im doing something wrong here.. but I cant see what. Any help is appreciated. <!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 content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Distance from Depot</title> </head> <body> <form id="distanceform"> <ul> <li> <label for="Distance from EverWarm Depot">Distance from Depot (km):</label> <input type="text" id="distance" class="large"/> </li> </ul> </form> <input name="Button1" type="button" value="calculate" onclick="deliverycost()"/> <form id="deliverycostform"> <ul> <li> <label for="Delivery Cost" >Delivery Cost:</label> <input type="text" id="deliverycost" class="large"/> </li> </ul> </form> <script> function deliverycost() { /* Here is the delivery cost: less than or equal to twenty kilometres is $20.00 greater than twenty kilometres is $35.00 */ var distance = document.forms["neworder"]["distance"].value; if(distance<20) { document.getElementById('deliverycost').innerHTML="$20"; } else { document.getElementById('deliverycost').innerHTML="$35"; } } </script> </body> </html> Is it necessary (or advisable) to place <form> tags around input buttons? They seem to work fine either way. Code: <input type="button" value=" Home " onClick="parent.main.location='home.htm'"> Hi guys, I am new to Javascript and I'm trying to set up a form to make simple calculation based on user inputs. I have set up the form and am unable to get the calculation to work despite what I try (this is based on an online tutorial I found though). Is there any where I am going wrong? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript" language="javascript"> function kanban() { //variables A = document.frmone.annualdemand.value; B = document.frmone.demandVariability.value; C = document.frmone.weeksHold.value; D = document.frmone.ContainerSize.value; E = document.frmone.totalStock.value; //calculation F = A/240; double G = (b/100)+1; H = g*F; c = c*5; i = c*H; j = i/d; document.frmone.totalStock.value = i; document.frmone.noKanBans.value = j; } </script> <title>Insert Title Here</title> </head> <body> <form name="kanban" id="frmone"> Annual Demand: <input type="text" name="annualDemand" value=""/> </br> Demand Variation: <input type="text" name="demandVariability" value=""/> </br> Stock to Hold (weeks): <input type="text" name="weeksHold" value=""/> </br> Size of Container: <input type="text" name="containerSize" value=""/> </br> </br> <input type="button" name="calculate" value="Calculate" onclick="kanban()"/> </br> </br> Total Stock: <input type="text" name="totalStock" value=""/> </br> Qty of Kan Bans: <input type="text" name="noKanBans" value=""/> </br> </form> </body> </html> Thanks guys. I'm trying to figure out how to add a length paramater to this function. Not quite sure how to do it. here's what I tried: Code: var phone = document.getElementById('phone'); if(isNumericdashes(phone, "Please enter a valid phone number")){ return true; } function isNumericdashes(elem, helperMsg){ var numericExpression = /^[0-9\(\)-]+$/; if(elem.value.match(numericExpression) &&(elem.length > 9)){ return true; }else{ alert(helperMsg); elem.focus(); return false; } } I was curious if there is a method to keep a single input from submitting a form. I have an input into which I'm building a drop down search feature, however, I'd like it so when the user presses return there, instead of submitting the form, it runs an AJAX POST instead. I am currently using keyUp to recognize the button press, but its still submitting the form its attached to. Obviously, I'd like that not to happen. Hello guys, Could you please help me with JavaScript that updates input by onKeyUp event. By updating input name products_data[XXXXXX][purchase_price] or input name products_data[XXXXXX][av_factor] shoul be updates input name products_data[XXXXXX][price] by formula: products_data[XXXXXX][purchase_price] * products_data[XXXXXX][av_factor] = products_data[XXXXXX][price] Because form has alot of integer values for each id: XXXXXX it need to be changes price for exactly id, not all. Code: function updatePrice() { var purchase_price = 100 var av_factor = 3; price = purchase_price * av_factor } <form name="product"> <input type="text" name="products_data[29796][purchase_price]" onKeyUp="updatePrice()" /> <input type="text" name="products_data[29796][av_factor]" onKeyUp="updatePrice()" /> <input type="text" name="products_data[29796][price]" /> <input type="text" name="products_data[29797][purchase_price]" onKeyUp="updatePrice()" /> <input type="text" name="products_data[29797][av_factor]" onKeyUp="updatePrice()" /> <input type="text" name="products_data[29797][price]" /> <input type="text" name="products_data[29798][purchase_price]" onKeyUp="updatePrice()" /> <input type="text" name="products_data[29798][av_factor]" onKeyUp="updatePrice()" /> <input type="text" name="products_data[29798][price]" /> ... </form> Thank you for any suggestion Best Regards Hello, Working With a touch screen, have created HTML page that has a custom keyboard for password input, no mouse or keyboard connected. Is there a way to enter keystrokes from the HTML into a (my form) text area (password) using Java. From the example below I am trying to put (1) into myform. <td><a class="Keys" type="password" target="myform">1</a></td> <!-- This Did not Work--> Thank You for any Info. Hey all, I have a simple form that looks something like this: Code: <div id="responses"> <input class="checkbox" type="checkbox" name="group1" value="1" id="option1"/><label class="label" for="option1">Option one text</label> <input class="checkbox" type="checkbox" name="group1" value="0" id="option2"/><label class="label" for="option2">Option two text</label> <input class="checkbox" type="checkbox" name="group1" value="1" id="option3"/><label class="label" for="option3">Option three text</label> </div> I am trying to figure out a way to use javascript to take these and randomize the order of them. For example, if you were looking at it and clicked a randomize button it would shuffle around the options. I am fairly new to javascript and don't really know where to start with something like this. I would greatly appreciate it if someone could get me started or point me in the right direction. Thanks! Hey all, i'm new here and first off, i'd just like to offer my sincerest appologies if i've posted this in the wrong section! I've made some basic HTML web sites in the past and now the company i work for has asked me to make one. Its a rubber roller manufacture company and i would like to make a page that will have input fields and a submit button that will send the inputted details to our sales manager's email address...something like this Contact Name: (input box) Company Name: (input box) Roller Diameter: (input box) Required Compound: (input box) Email Address: (input box) (SEND BUTTON) Also it would be a massive help if someone could tell me if it is possible for me to set it so that once the send button is clicked, it will send an email of the data but also redirect to another page (just saying thanks for input etc etc) HUGE thanks in advance!!! Hello, I am trying to add radio buttons in this quiz script that i'm using, but when i change the drop down box to radio buttons the quiz script stops working, i.e it will not calculate the correct answers / percentage. I dont think i am correctly adding the input type "radio" and the script cannot recognise the value properly as i'am trying to make custom radio buttons from javascript / css. here is the script thats stopped working but how do i make the radio buttons send the correct value to the quiz script? Hope someone can help, i can add the css file if need be.. Code: <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=yes;" /> <TITLE>Seventies Trivia Quizzes & Games</TITLE> <link rel="stylesheet" type="text/css" href="style.css" /> <script language=Javascript> <!-- function stopErrors(){ return true; } window.onerror=stopErrors; // --> </script> <script language="JavaScript1.1"> <!-- Hide from old browsers function quiz(form) { var i = 0 var result1=document.form1.answer1.selectedIndex var result2=document.form2.answer2.selectedIndex var result3=document.form3.answer3.selectedIndex var result4=document.form4.answer4.selectedIndex var result5=document.form5.answer5.selectedIndex var result6=document.form6.answer6.selectedIndex var result7=document.form7.answer7.selectedIndex var result8=document.form8.answer8.selectedIndex if (result1==0){ alert("Question #1 was not answered");} if (result2==0){ alert("Question #2 was not answered");} if (result3==0){ alert("Question #3 was not answered");} if (result4==0){ alert("Question #4 was not answered");} if (result5==0){ alert("Question #5 was not answered");} if (result6==0){ alert("Question #6 was not answered");} if (result7==0){ alert("Question #7 was not answered");} if (result8==0){ alert("Question #8 was not answered");} else { if (result1==3){i++} if (result2==3){i++} if (result3==1){i++} if (result4==4){i++} if (result5==3){i++} if (result6==1){i++} if (result7==1){i++} if (result8==2){i++} document.total.score.value = i var per = Math.round((i / 20) * 100) document.total.percent.value = per if (result1 != 3){document.form1.check1.checked = true} else {document.form1.check1.checked = false} if (result2 != 3){document.form2.check2.checked = true} else {document.form2.check2.checked = false} if (result3 != 1){document.form3.check3.checked = true} else {document.form3.check3.checked = false} if (result4 != 4){document.form4.check4.checked = true} else {document.form4.check4.checked = false} if (result5 != 3){document.form5.check5.checked = true} else {document.form5.check5.checked = false} if (result6 != 1){document.form6.check6.checked = true} else {document.form6.check6.checked = false} if (result7 != 1){document.form7.check7.checked = true} else {document.form7.check7.checked = false} if (result8 != 2){document.form8.check8.checked = true} else {document.form8.check8.checked = false} } } //--> </SCRIPT> <style type="text/css"> <!-- body { margin-left: 10px; margin-top: 10px; margin-right: 10px; margin-bottom: 10px; } --> </style></HEAD> <BODY> <FORM NAME="form1"><INPUT TYPE="hidden" NAME="check1"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer1" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-1a0"> <input name="sample-radio" id="sample-radio-1a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-1a1"> <input name="sample-radio" id="sample-radio-1a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-1a2"> <input name="sample-radio" id="sample-radio-1a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-1a3"> <input name="sample-radio" id="sample-radio-1a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-1a4"> <input name="sample-radio" id="sample-radio-1a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form2"><INPUT TYPE="hidden" NAME="check2"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer2" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-2a0"> <input name="sample-radio" id="sample-radio-2a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-2a1"> <input name="sample-radio" id="sample-radio-2a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-2a2"> <input name="sample-radio" id="sample-radio-2a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-2a3"> <input name="sample-radio" id="sample-radio-2a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-2a4"> <input name="sample-radio" id="sample-radio-2a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form3"><INPUT TYPE="hidden" NAME="check3"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer3" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-3a0"> <input name="sample-radio" id="sample-radio-3a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-3a1"> <input name="sample-radio" id="sample-radio-3a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-3a2"> <input name="sample-radio" id="sample-radio-3a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-3a3"> <input name="sample-radio" id="sample-radio-3a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-3a4"> <input name="sample-radio" id="sample-radio-3a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form4"><INPUT TYPE="hidden" NAME="check4"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer4" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-4a0"> <input name="sample-radio" id="sample-radio-4a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-4a1"> <input name="sample-radio" id="sample-radio-4a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-4a2"> <input name="sample-radio" id="sample-radio-4a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-4a3"> <input name="sample-radio" id="sample-radio-4a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-4a4"> <input name="sample-radio" id="sample-radio-4a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form5"><INPUT TYPE="hidden" NAME="check5"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer5" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-5a0"> <input name="sample-radio" id="sample-radio-5a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-5a1"> <input name="sample-radio" id="sample-radio-5a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-5a2"> <input name="sample-radio" id="sample-radio-5a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-5a3"> <input name="sample-radio" id="sample-radio-5a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-5a4"> <input name="sample-radio" id="sample-radio-5a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form6"><INPUT TYPE="hidden" NAME="check6"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer6" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-6a0"> <input name="sample-radio" id="sample-radio-6a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-6a1"> <input name="sample-radio" id="sample-radio-6a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-6a2"> <input name="sample-radio" id="sample-radio-6a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-6a3"> <input name="sample-radio" id="sample-radio-6a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-6a4"> <input name="sample-radio" id="sample-radio-6a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form7"><INPUT TYPE="hidden" NAME="check7"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer7" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-7a0"> <input name="sample-radio" id="sample-radio-7a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-7a1"> <input name="sample-radio" id="sample-radio-7a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-7a2"> <input name="sample-radio" id="sample-radio-7a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-7a3"> <input name="sample-radio" id="sample-radio-7a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-7a4"> <input name="sample-radio" id="sample-radio-7a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <FORM NAME="form8"><INPUT TYPE="hidden" NAME="check8"> <b>1. Who wrote the Eagles' 1972 hit "Take It Easy"?</b><BR><BR> <input type="hidden" SELECT NAME="answer8" SIZE=1> <fieldset class="radios"> <label class="label_radio" for="sample-radio-8a0"> <input name="sample-radio" id="sample-radio-8a0" NAME="radio" type="radio" SELECTED VALUE="0"/> CHOOSE AN ANSWER</label> <label class="label_radio" for="sample-radio-8a1"> <input name="sample-radio" id="sample-radio-8a1" NAME="radio" type="radio" VALUE="1" /> Randy Meisner</label> <label class="label_radio" for="sample-radio-8a2"> <input name="sample-radio" id="sample-radio-8a2" NAME="radio" type="radio" VALUE="2" /> J.D. Souther</label> <label class="label_radio" for="sample-radio-8a3"> <input name="sample-radio" id="sample-radio-8a3" NAME="radio" type="radio" VALUE="3" /> Jackson Browne & Glenn Frey</label> <label class="label_radio" for="sample-radio-8a4"> <input name="sample-radio" id="sample-radio-8a4" NAME="radio" type="radio" VALUE="4" /> Don Henley</label> </fieldset> </SELECT></FORM> <BR> <BR><BR><HR> <P>That's it! Now click the "Submit" button to grade your Seventies music knowledge.<BR> <form name="total"> <INPUT TYPE="BUTTON" VALUE="Submit" onClick="quiz()"> <INPUT TYPE="button" VALUE="Reload Quiz" onClick='parent.location="javascript:location.reload()"'><BR><HR><BR>Results:<BR><BR> You scored <INPUT TYPE="TEXT" NAME="score" VALUE="" SIZE=5> out of <INPUT TYPE="TEXT" NAME="outof" VALUE="8" SIZE=5> questions correct.<BR><BR> Your Sco <INPUT TYPE="TEXT" NAME="percent" VALUE="" SIZE=3> %<BR><BR> <HR> </FORM> <script> var d = document; var safari = (navigator.userAgent.toLowerCase().indexOf('safari') != -1) ? true : false; var gebtn = function(parEl,child) { return parEl.getElementsByTagName(child); }; onload = function() { var body = gebtn(d,'body')[0]; body.className = body.className && body.className != '' ? body.className + ' has-js' : 'has-js'; if (!d.getElementById || !d.createTextNode) return; var ls = gebtn(d,'label'); for (var i = 0; i < ls.length; i++) { var l = ls[i]; if (l.className.indexOf('label_') == -1) continue; var inp = gebtn(l,'input')[0]; if (l.className == 'label_check') { l.className = (safari && inp.checked == true || inp.checked) ? 'label_check c_on' : 'label_check c_off'; l.onclick = check_it; }; if (l.className == 'label_radio') { l.className = (safari && inp.checked == true || inp.checked) ? 'label_radio r_on' : 'label_radio r_off'; l.onclick = turn_radio; }; }; }; var check_it = function() { var inp = gebtn(this,'input')[0]; if (this.className == 'label_check c_off' || (!safari && inp.checked)) { this.className = 'label_check c_on'; if (safari) inp.click(); } else { this.className = 'label_check c_off'; if (safari) inp.click(); }; }; var turn_radio = function() { var inp = gebtn(this,'input')[0]; if (this.className == 'label_radio r_off' || inp.checked) { var ls = gebtn(this.parentNode,'label'); for (var i = 0; i < ls.length; i++) { var l = ls[i]; if (l.className.indexOf('label_radio') == -1) continue; l.className = 'label_radio r_off'; }; this.className = 'label_radio r_on'; if (safari) inp.click(); } else { this.className = 'label_radio r_off'; if (safari) inp.click(); }; }; </script> <P>Ratings:<br><br> 90-100% - "I Just Want To Celebrate"<br> 80-89% - "I Want To Take You Higher"<br> 70-79% - "One Toke Over The Line"<br> 60-69% - "What's Going On"<br> 50-59% - "Stuck In The Middle With You"<br> 0-49% - "Ball of Confusion"<br> </blockquote> </BODY> </HTML> |