HTML - Reset Form Button
Hello, I have done a search form in HTML (with something in Javascript), and a reset button that works perfectly. The search results are published on the same page of search form, but once its searched the reset button no longer works. So, once the form is submited, reset button stops working ... someone knows how can I fix it?
Thank you very much and best regards to all! Similar TutorialsOn an order entry web page I would like to code a reset button that clears out data a user has entered. Hey guys Im having trouble with some html code, if you could help out that would be great. What im trying to do is put an activeX control into a .htm page and use a html form. The .htm uses the activeX to read a .txt file, and displays the data in a table, with headings, descriptions, images, and a text box used for selecting a quantity. Then at the bottom of the page, I have made a simple send to email button, and a reset button. However my problem is; I dont think the code for the form is enclosing the whole table. Here's the code I hope this works... <body> <object id="Productlist"classid="CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83"> <param name="DataURL"value ="data/Partsproductlist.txt"/> <param name="UseHeader" value="TRUE"/> <param name="FieldDelim" value=","/> </object> <table DATASRC="#Productlist" style="border-style: ridge; border-color:darkseagreen; background-color:lightcyan"> <thead><tr style="background-color:aqua"> <th></th> <th>Product Name</th> <th>Product Description</th> <th>Unit Price</th> <th>Quantity</th> </TR></thead> <tbody> <tr style="background-color: ***hsia"> <td><span><img DATASRC ="#Productlist" DATAFLD="ProdImage" width="150" height="150" /></span></td> <td><span DATAFLD ="ProductName"></span></td> <td><span DATAFLD="ProductDescription"></span></td> <td><span DATAFLD="UnitPrice"></span></td> <td> <form><input type="text" name="quantity" id="numberinput" value="0" tabindex="0"/></form></td> </tr> </tbody> </table> <form Name="FormProductBoundOrder" method="post" action="mailto:abc@abc.co.uk" subject="emailsubjectwouldgohere"> <input type="submit" value="send"/> <input type="reset"/> i have written a simple html form code the problem is that this code is working fine when run in interner explorer, if i run in mozilla firefox form reset button work as submit button it show submit validation code when reset button press, can any one help me here is the code <script type="text/javascript"> function validation() { alert("submit buton has pressed"); return true; } </script> <body> <form id="form1" name="form_feedback" method="post" onsubmit="return validation();"> <table width="488" border="0"> <!--DWLayoutTable--> <tr> <td width="85"><span>Name:</span></td> <td width="393"><input name="txt_name" type="text" id="textfield2" size="35" /></td> </tr> <tr> <td><span>Email:</span></td> <td><input name="txt_email" type="text" id="textfield3" size="35" /></td> </tr> <tr> <td><span>Address:</span></td> <td height="0"><label> <textarea name="txt_address" id="textarea" cols="45" rows="2"></textarea> </label></td> </tr> <tr> <td><span>Phone No:</span></td> <td height="0"><input name="txt_phoneno" type="text" id="textfield4" size="20" onkeypress="return numeralsOnly(event)" /></td> </tr> <tr> <td><span>Comments For:</span></td> <td height="0"><input name="txt_commentsfor" type="text" id="textfield5" size="20" /></td> </tr> <tr> <td><span>Comments:</span></td> <td height="0"><label> <textarea name="txt_comments" id="textarea2" cols="45" rows="5"></textarea> </label></td> </tr> <tr> <td height="0"><label> <input type="submit" name="btn_submit" value="Submit"/> <input type="reset" value="Reset" name="btn_reset"/> </label></td> </tr> </table> </form> </body> how would i make a form that would send me an e-mail? What i need for it is a place to umput text and a submit button. Also, how would i put a reset button for that? Hello, I have a simple quiz with 3 parts: the quiz, the results page, and a printable certificate. On the first page (the quiz itself), I have a form with 20 questions and at the bottom is two buttons: Submit and Reset. Both of these work great, that's not the problem. The problem is on the second page. IF the user did not score high enough, they cannot proceed to the printable certificate and must retake the quiz. For this I have a button which takes them back to the quiz. Unfortunately, I can't get it to reset the form. Here's my code for the button: Code: <input type="button" value="Try Again" name="tryagain" onClick="history.go(-1); document.TrainingVideosTest.reset()"> The form on the first page is named TrainingVideosTest. Here's the code for the reset button on the quiz page: Code: <input type="button" value="Reset" name="resetform" onClick="document.TrainingVideosTest.reset()"> Does anybody know how to reset form data from another page? Is there a way to insure that all form fields are reset to empty or default values upon entry to the page that contains the form? I'm asking this because if someone has already submitted a form and arrives at the next screen, that form has already been logged. If they go back, it gets logged again and I don't want that. I would prefer that the solution would involve HTML &/or PHP because many people have Java script disabled. But, if it can't be done with HTML or PHP, then so be it. I'll have to use Javascript. My first thought was to somehow disable the "Back" button but that is probably offensive to many, and I wouldn't want to alienate anyone. Maybe someone on this forum might have the answer to my question or may be able to suggest another approch I could use. Thanking you in advance, Roy Hello, I would like to move my button or <FORM> to different position than at the default location. How can I do that? Hi everyone, Is it possible to have a form without a submit button. I know you can use links etc to submit a form but can you just have nothing, so the user just hits the enter key and the form submits ? cheers Ok. This is my coding for my form button. The opacity changes, when hovered over, in my editor and in IE - but it doesnt work in Netscape - any suggestions or ideas???? <input type="image" src="buttons.jpg" onmouseover="this.style.Opacity=1.0[1];this.filters.alpha.opacity=100" onmouseout="this.style.Opacity=0.7[1];this.filters.alpha.opacity=70" style="filter:alpha(opacity=70);opacity:0.7.[1]" size="25" value="Find password" /> Hi guys, I'm currently making a simple website for a coffee website and am currently working on the order page, which is a form and uses javascript. After trying to make the 'help' button open a new page, pretty much everything stuffed up and i'm in need of urgent help. Any help would be greatly appreciated. Here is the HTML: HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <title>Order Coffee</title> <script language="JavaScript" type="text/javascript" src="../javascript/order.js"> </script> <link rel="Stylesheet" href="../CSS/coffee.css" type="text/css" /> </head> <body> <!-- The whole page is a form --> <form name="payment" action="" onClick="return goTohelp();" onSubmit="return validateOrder();"> <h1> Elmilio's Cafe </h1> <br /> At Elmilio's Cafe we like to ensure that our deliveries are fast and on time <br /> <b> Please fill in all the boxes to complete your order </b> <table border= "0" cellspacing= "5"> <tr align="left"> <td> First Name: </td> <td><input name="firstName" type="text" value="" /></td> <td> Surname: </td> <td><input name="surname" type="text" value="" /></td> </tr> <tr> <td> Address: </td> <td><input name="address" type="text" value="" /></td> </tr> <tr> <td> Suburb: </td> <td><input name="suburb" type="text" value="" /></td> <td> State: </td> <td> <select name="state"> <option value="0">South Australia</option> <option value="1">Victoria</option> <option value="2">New South Wales</option> <option value="3">Queensland</option> <option value="4">Northern Territory</option> <option value="5">Western Australia</option> <option value="6">Tasmania</option> </select> </td> <td> Postcode: </td> <td><input name="postcode" type="text" value="" /></td> </tr> <tr> <td> Email: </td> <td><input name="email" type="text" value="" /></td> <td> Contact Number: </td> <td><input name="contactNumber" type="text" value="" /></td> </tr> </table> <hr /> Enter your coffee order: <br /> <textarea name="comments" cols="40" rows="5"> Enter your coffee order here... </textarea><br /> <hr /> Please enter method of payment <p> <input name="r" type="radio" value="creditcard" onclick="creditcard()"/> Credit Card <input name="r" type="radio" value="paypal" onclick="paypal()"/> Paypal <input name="r" type="radio" value="onlinebanking" onclick="onlinebanking()"/> Online Banking <div id="creditcard"> <hr /> <img src="../images/creditcard.jpg" alt="Credit card options"/> <table border= "0"> <tr align="left"> <th>Type of Credit Card</th> <th>Name on the Card</th> <th>Card Number</th> <th>Expiry Date</th> </tr> <tr> <td><select name=""> <option value="0">Visa</option> <option value="1">Mastercard</option> <option value="2">American Express</option> </select></td> <td><input name="nameonCard" type="text" value="" /></td> <td><input name="cardNumber" type="text" value="" /></td> <td><select name=""> <option value="0">01</option> <option value="1">02</option> <option value="2">03</option> <option value="3">04</option> <option value="4">05</option> <option value="5">06</option> <option value="6">07</option> <option value="7">08</option> <option value="8">09</option> <option value="9">10</option> <option value="10">11</option> <option value="11">12</option> </select> / <td> <select name=""> <option value="0">2010</option> <option value="1">2011</option> <option value="2">2012</option> <option value="3">2013</option> </select> </td></tr> </table> </p> Place your order <input type="submit" value="Submit" /> <input type="submit" value="Clear Form" /> <input type="submit" value="Help" onClick="goTohelp()"/> </div> <div id="paypal"> <hr /> <a href="https://www.paypal.com"/> <img src="../images/Paynow.jpg" alt="Pay now" border="0"/> </a href> </p> <br /> <input type="submit" value="Clear Form" /> <input type="submit" value="Help" /> </div> <div id="onlinebanking"> <hr /> <b> Account Name: </b> Elmilio's Cafe <br> <b> Bank: </b> Westpac Bank <br> <b> BRB: </b> 28 5265 <br> <b> Account No.: </b> 8276 1736 <br> Please give us the reference number, given <br> Place your order <br> <input type="submit" value="Submit" /> <input type="submit" value="Clear Form" /> <input type="submit" value="Help" /> </div> <div id = "bottom_links2"> <hr /> <a href="contact.html"> Contact Us </a>| <a href="privacy.html"> Privacy </a>| <a href="copyright.html"> Copyright </a> <br /> <a href="mailto:williamdickeson@yahoo.com.au?subject=Coffee Query"> Contact the Web Administrator </a> </div> </div> </form> </body> </html> Here is the javascript: PHP Code: //This will display the Credit Card div when the Credit Card radio button is selected function creditcard(){ document.getElementById("creditcard").style.display = "block"; document.getElementById("paypal").style.display = "none"; document.getElementById("onlinebanking").style.display = "none"; } //This will display the Paypal div when the Paypal radio button is selected function paypal(){ document.getElementById("paypal").style.display = "block"; document.getElementById("creditcard").style.display = "none"; document.getElementById("onlinebanking").style.display = "none"; } //This will display the Online Banking div when the Online Banking radio button is selected function onlinebanking(){ document.getElementById("onlinebanking").style.display = "block"; document.getElementById("creditcard").style.display = "none"; document.getElementById("paypal").style.display = "none"; } //Check if email is entered correctly function validateOrder() { var email= new String(document.payment.email.value); if (email == "" || email.indexOf("@") == -1) { alert ("Your email address is not valid"); } //Check if first name is entered var firstName= new String(document.payment.firstName.value); if (firstName == "") { alert ("You have not entered your first name"); } //Check if surname is entered var surname= new String(document.payment.surname.value); if (surname == "") { alert ("You have not entered your surname"); } //Check if address is entered var address= new String(document.payment.address.value); if (address == "") { alert ("You have not entered your address"); } //Check if suburb is entered var suburb= new String(document.payment.suburb.value); if (suburb == "") { alert ("You have not entered your suburb"); } //Check if postcode is entered var postcode= new String(document.payment.postcode.value); if (postcode.length != "4") { alert ("Your postcode must have four digits"); } //Check if contactNumber is entered var contactNumber= new String(document.payment.contactNumber.value); if (contactNumber == "") { alert ("You have not entered your contact number"); } //Check if nameonCard is entered var nameonCard= new String(document.payment.nameonCard.value); if (nameonCard == "") { alert ("You have not entered your name on your credit card"); } //Check if cardNumber is entered var cardNumber= new String(document.payment.cardNumber.value); if (cardNumber == "") { alert ("You have not entered your card number"); } function goTohelp() { var window.location = "http://javascript.internet.com/new"; } } } I want to make a form that when you type in it it doesnt show what you are typing, i want it to show "Albert please answer the following question" and then you type a semi colon it goes into another box (irrelevant) but when you type a ? in the second box the actual phrase that you typed in the first box (the one that was hidden by my phrase) to come up under the whole thing, and then when you hit the "new question" button it should reset itself. i figured that the way you could do this is by connecting the first box with the answer box but i cant figure out how to make this happen iwhtout using php. I think the title says it all. I want to submit the information from a form to 2 different pages: one page is an external page (so it starts with action=http://www.otherserver.com/somescript.php), and the other is internal (so it starts with action=myscript.php). And all that is done with a click of a button, so don't tell me to use 2 buttons The reason why I want to do this, because I want to put the information in my database as well. Is there a way to get around this? Or maybe another technique to get the same purpose? 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 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. 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 <html> <form> <p><input type="text" name="T1" size="20" /></p> <p><input type="submit" value="B1" name="B1" /></p> <p><input type="submit" value="B2" name="B2" /></p> </form> </html> Say I have the above form in a web page. When the page loads, the browser will highlight the first submit button b1, such that if the user hits enter, the form is submitted with that button. I'd like the default button to be B2, which is displayed second on the form. I'd greatly appreciate any advice on how to accomplish this. Thanks, jsfgguy Hi guys, I have made a website, and it has a text box that I want people to type their email address in, and I have a regular link next to it that says "submit" (not a button or anything). Basically I want the email address that they have entered to be emailed to me when they click the submit link. My hosting is currently just free-hosting at awardspace - is this possible to do there? If not - generally how can I make it work? Thank you for any replies posted :-) Hello All! I am a newbie to HTML and am having the most troubling time getting my submit button on my form to redirect to another webpage. I have been reading (searching) through previous posts on this issue but none solved my problem. I am really hoping someone can offer some help so let me explain my issue exacly. I have a simple form on my "Contact Us" page with a few fields and a [Submit]button. After the form is filled out and the [Submit] button is pressed, I would like it to re-direct to a "Thank-You" page I created. Below is my code: <form action="gdform.asp" method="post" name="contact_us" id="contact_us" target="cont"> <input name="submit" type="image" value="submit" src="images/Submit.gif"> If I take target="cont" out, it redirects to the home page. I have been trying to figure this out for so long now and searching online with no luck. Any help with this would be GREATLY appreciated!!!! Thanks! Hi, Yesterday, I wasted a couple hours trying to center the Paypal button inside a form inside a table. You can see it near the bottom of this page: http://www.jesussaidfollowme.org/new...t-theology.htm Do you know how to solve my puzzle? Thank you, Greg |