473,378 Members | 1,138 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

My reset button in my form does not clear my form??

Hi all,

I have created a form using a table. I have created a reset form and a send email button.

I thought my reset button would clear my form, but this is not happening and I am not sure if this can be fixed. My site is not live at present but this is my code for the form:

Expand|Select|Wrap|Line Numbers
  1.  <table width="600" border="0" cellspacing="0" cellpadding="2">
  2.           <tr>
  3.             <td align="right"><form id="form1" name="form1" method="post" action="">
  4.               <label for="name">Full Name:</label>
  5.             </form></td>
  6.             <td align="left"><input name="name" type="text" id="name" maxlength="35" /></td>
  7.           </tr>
  8.           <tr>
  9.             <td align="right"><form id="form2" name="form2" method="post" action="">
  10.               <label for="email">Email Address:</label>
  11.             </form></td>
  12.             <td align="left"><input name="email" type="text" id="email" maxlength="30" /></td>
  13.           </tr>
  14.           <tr>
  15.             <td align="right"><form id="form3" name="form3" method="post" action="">
  16.               <label for="comment">Comment:</label>
  17.             </form></td>
  18.             <td align="left"><textarea name="comment" id="comment" cols="35" rows="5"></textarea></td>
  19.           </tr>
  20.           <tr>
  21.             <td align="right"><form id="form4" name="form4" method="post" action="">
  22.               <label for="where">How did you find us?</label>
  23.             </form></td>
  24.             <td align="left"><form id="form5" name="form5" method="post" action="">
  25.               <select name="where" id="where">
  26.                 <option>Choose one...</option>
  27.                 <option value="google">Google</option>
  28.                 <option value="yahoo">Yahoo</option>
  29.                 <option value="Bing">Bing</option>
  30.                 <option value="youtube">Youtube</option>
  31.                 <option value="other">Other</option>
  32.               </select>
  33.             </form></td>
  34.           </tr>
  35.           <tr>
  36.             <td align="right"><form id="form6" name="form6" method="post" action="">
  37.               <input type="reset" name="resetform" id="resetform" value="Reset form" />
  38.             </form></td>
  39.             <td align="left"><input type="submit" name="submit" id="submit" value="Send Email" /></td>
  40.           </tr>
  41.         </table>
  42.       </div>
Can anyone help me please :)

Thank you in advance for any help
Caroline
Mar 30 '13 #1
5 19282
Rabbit
12,516 Expert Mod 8TB
That's because your reset button is in a different form than your other controls. I'm not sure why you're encapsulating each control in their own form.
Mar 31 '13 #2
@Rabbit
Thanks Rabbit for your reply. I am very new to dreamweaver and creating forms, (this is my first one). I am not sure what you mean that each of my controls are in their own form.

I followed a youtube video and everything worked for them using the table format to build the form??

So how would I fix this?? In simple terms please :)

Thanks
Caroline
Mar 31 '13 #3
Hi Rabbit, it's ok now, I have fixed the problem. Thank you for your help :)

I basically started again, not sure what I done wrong first time, but at least it is working now.

Thanks again
Caroline
Mar 31 '13 #4
Rabbit
12,516 Expert Mod 8TB
Here's what was happening. You had something like this:
Expand|Select|Wrap|Line Numbers
  1. <form>
  2.  <input>
  3. </form>
  4.  
  5. <form>
  6.  <input>
  7. </form>
  8.  
  9. <form>
  10.  <input>
  11. </form>
Each of those is in their own form.

What you want is for all of them to be in one form. Like this:
Expand|Select|Wrap|Line Numbers
  1. <form>
  2.  <input>
  3.  <input>
  4.  <input>
  5. </form>
Mar 31 '13 #5
Thank you Rabbit for all your help :) Got it fixed.

Caroline
Apr 1 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Matt | last post by:
i need to implement a clear button to clear all the fields in the form, but i am thinking i can just use reset button. <input type="reset" name="reset" value="CLEAR"> The first thought is...
2
by: angus | last post by:
Dear All, I have to implement a reset button in the web form. i think that i can use the web component(button) to get the fired onclick event on the reset button. after the postback, the...
1
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset...
7
by: Kermit Piper | last post by:
Hello, How can you clear session variables when a reset button is pressed? I thought I might be able to do something like: <% If request.form("Reset") = "Reset" then Session("variable") =...
3
by: kashif_khan | last post by:
hi everyone, can anybody please tell me why reset button is not working in the following code, i tested it in opera, firefox and konqueror, <form action='edit_links.php' method='POST'...
5
abouddan
by: abouddan | last post by:
Hi all I have an Access2000 form that contain many TextBoxes and a button. That button inserts the data in tables. How can reset all the TextBoxes automaticly without doing that one by one and...
11
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field...
5
by: plumba | last post by:
Ok, another query.... I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button. The problem I have is when the clear form button is...
1
by: johnacooke | last post by:
I have a HTML form that is generated in part by PHP. The action attribute on the form tag calls itself, so that I can validate the fields without using any other form of code like Javascript to...
1
by: joshapalooza | last post by:
I am using a form to sort a report, but I can't seem to get the "clear form" button to work. I used the wizard when I installed the button, using the clear form option under the form option list....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.