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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cazbarr
    New Member
    • Mar 2013
    • 4

    #1

    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:

    Code:
     <table width="600" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td align="right"><form id="form1" name="form1" method="post" action="">
                  <label for="name">Full Name:</label>
                </form></td>
                <td align="left"><input name="name" type="text" id="name" maxlength="35" /></td>
              </tr>
              <tr>
                <td align="right"><form id="form2" name="form2" method="post" action="">
                  <label for="email">Email Address:</label>
                </form></td>
                <td align="left"><input name="email" type="text" id="email" maxlength="30" /></td>
              </tr>
              <tr>
                <td align="right"><form id="form3" name="form3" method="post" action="">
                  <label for="comment">Comment:</label>
                </form></td>
                <td align="left"><textarea name="comment" id="comment" cols="35" rows="5"></textarea></td>
              </tr>
              <tr>
                <td align="right"><form id="form4" name="form4" method="post" action="">
                  <label for="where">How did you find us?</label>
                </form></td>
                <td align="left"><form id="form5" name="form5" method="post" action="">
                  <select name="where" id="where">
                    <option>Choose one...</option>
                    <option value="google">Google</option>
                    <option value="yahoo">Yahoo</option>
                    <option value="Bing">Bing</option>
                    <option value="youtube">Youtube</option>
                    <option value="other">Other</option>
                  </select>
                </form></td>
              </tr>
              <tr>
                <td align="right"><form id="form6" name="form6" method="post" action="">
                  <input type="reset" name="resetform" id="resetform" value="Reset form" />
                </form></td>
                <td align="left"><input type="submit" name="submit" id="submit" value="Send Email" /></td>
              </tr>
            </table>
          </div>
    Can anyone help me please :)

    Thank you in advance for any help
    Caroline
    Last edited by Rabbit; Mar 31 '13, 06:45 AM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    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.

    Comment

    • cazbarr
      New Member
      • Mar 2013
      • 4

      #3
      Originally posted by Rabbit
      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.
      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

      Comment

      • cazbarr
        New Member
        • Mar 2013
        • 4

        #4
        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

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          Here's what was happening. You had something like this:
          Code:
          <form>
           <input>
          </form>
          
          <form>
           <input>
          </form>
          
          <form>
           <input>
          </form>
          Each of those is in their own form.

          What you want is for all of them to be in one form. Like this:
          Code:
          <form>
           <input>
           <input>
           <input>
          </form>

          Comment

          • cazbarr
            New Member
            • Mar 2013
            • 4

            #6
            Thank you Rabbit for all your help :) Got it fixed.

            Caroline

            Comment

            Working...