PDA

View Full Version : build a form in Dreamweaver, RESET button won't work


KTY
10-26-2009, 11:36 AM
I follow this video to make the form:

http://www.youtube.com/watch?v=7soyO5DwJMY

Everything is fine except the reset button won't work!

Can anyone help?

Corrosive
10-26-2009, 12:56 PM
Not unless you can post some code or show us online. Otherwise we'd just be guessing what is wrong.

KTY
10-26-2009, 01:17 PM
<form id="form1" name="form1" method="post" action="">
<table width="333" border="0" cellpadding="6">
<tr>
<td width="109"><div align="right">
<span class="style15">
<label for="full name"><span class="style24">*</span> Full name:</label>
</span> </div></td>
<td width="194"><div align="left">
<input name="full name" type="text" id="full name" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="email"><span class="style24">*</span> E -mail:</label>
</span> </div></td>
<td><div align="left">
<input name="email" type="text" id="email" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="address">Address:</label>
</span> </div></td>
<td><div align="left">
<input name="address" type="text" id="address" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="state">State:</label>
</span> </div></td>
<td><div align="left">
<input name="state" type="text" id="state" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="city">City:</label>
</span> </div></td>
<td><div align="left">
<input name="city" type="text" id="city" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="country">Country:</label>
</span> </div></td>
<td><div align="left">
<input name="country" type="text" id="country" size="20" />
</div></td>
</tr>
<tr>
<td><span class="style16">
<span class="style17">
<label for="postcode"> </label>
</span></span>
<span class="style17">
<label for="postcode"></label>
</span>
<span class="style19">
<label for="postcode"></label>
</span>
<label for="postcode"><div align="right" class="style15">Postcode:</div>
</label></td>
<td><input name="postcode" type="text" id="postcode" size="20" /></td>
</tr>
</table>
</form>
</div>
<div id="apDiv23">
<table width="339" border="0" cellpadding="6">
<tr>
<td width="90"><div align="right">
<span class="style15">
<label for="phone">Phone:</label>
</span> </div></td>
<td width="219"><div align="left">
<input name="phone" type="text" id="phone" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="mobile">Mobile:</label>
</span> </div></td>
<td><div align="left">
<input name="mobile" type="text" id="mobile" size="20" />
</div></td>
</tr>
</table>
<table width="338" border="0" cellpadding="6">
<tr>
<td width="90"><div align="right">
<span class="style15">
<label for="comments"><span class="style24">*</span> Comments:</label>
</span> </div></td>
<td width="218"><div align="left">
<textarea name="comments" cols="20" rows="4" id="comments"></textarea>
</div></td>
</tr>
<tr>
<td>
<div align="right">
<input name="newsletter" type="checkbox" id="newsletter" value="subscribeme" checked="checked" />
</div></td>
<td><span class="style24">
<span class="style19">
<label for="newsletter"><span class="style26">Subscribe to our FREE online Newsletter!</span></label>
</span>
<label for="newsletter"></label>
</span></td>
</tr>
</table>
</div>
<div id="apDiv24">
<table width="337" border="0" cellpadding="6">
<tr>
<td width="224"><div align="right">
<label for="clear"></label>
<input type="reset" name="clear" id="clear" value="clear" />
</div></td>
<td width="83"><div align="left">
<label for="send"></label>
<input type="submit" name="send" id="send" value="Send" />
</div></td>
</tr>
</table>
</div>
</body>
</html>

Corrosive
10-26-2009, 01:49 PM
Bloody hell that is a LOT of code for a form!!! Beware youtube videos as they are not 'sense-checked' by anyone so you could be following absolute garbage.

The main problem I can see from that is half your form is outside of your closing </form> tag. This means it is not part of your form. Look at moving this tag to the end of your form code.

KTY
10-26-2009, 11:42 PM
Thanks Corrosive!

So... what do I do to make the CLEAR button work??? (I have absolutely no idea how to use Dreamweaver :o)

edbr
10-27-2009, 12:53 AM
<input name="" type="reset" value="Reset" />
this is one of the major advantages of dreamweaver its wizards allow you to (in this case) INSERT>FORM>BUTTON
then in properties choose reset

KTY
10-27-2009, 03:00 AM
No, tried that but it didn't work! (((crying T.T)))

Can anyone check my Dreamweaver file!!!??? Please :(

edbr
10-27-2009, 03:26 AM
you must include the button in the form<form id="form1" name="form1" method="post" action="">
<table width="333" border="0" cellpadding="6">
<tr>
<td width="109"><div align="right">
<span class="style15">
<label for="full name"><span class="style24">*</span> Full name:</label>
</span> </div></td>
<td width="194"><div align="left">
<input name="full name" type="text" id="full name" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="email"><span class="style24">*</span> E -mail:</label>
</span> </div></td>
<td><div align="left">
<input name="email" type="text" id="email" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="address">Address:</label>
</span> </div></td>
<td><div align="left">
<input name="address" type="text" id="address" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="state">State:</label>
</span> </div></td>
<td><div align="left">
<input name="state" type="text" id="state" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="city">City:</label>
</span> </div></td>
<td><div align="left">
<input name="city" type="text" id="city" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="country">Country:</label>
</span> </div></td>
<td><div align="left">
<input name="country" type="text" id="country" size="20" />
</div></td>
</tr>
<tr>
<td><span class="style16">
<span class="style17">
<label for="postcode"> </label>
</span></span>
<span class="style17">
<label for="postcode"></label>
</span>
<span class="style19">
<label for="postcode"></label>
</span>
<label for="postcode"><div align="right" class="style15">Postcode:</div>
</label></td>
<td><input name="postcode" type="text" id="postcode" size="20" /></td>
</tr>
</table>

</div>
<div id="apDiv23">
<table width="339" border="0" cellpadding="6">
<tr>
<td width="90"><div align="right">
<span class="style15">
<label for="phone">Phone:</label>
</span> </div></td>
<td width="219"><div align="left">
<input name="phone" type="text" id="phone" size="20" />
</div></td>
</tr>
<tr>
<td><div align="right">
<span class="style15">
<label for="mobile">Mobile:</label>
</span> </div></td>
<td><div align="left">
<input name="mobile" type="text" id="mobile" size="20" />
</div></td>
</tr>
</table>
<table width="338" border="0" cellpadding="6">
<tr>
<td width="90"><div align="right">
<span class="style15">
<label for="comments"><span class="style24">*</span> Comments:</label>
</span> </div></td>
<td width="218"><div align="left">
<textarea name="comments" cols="20" rows="4" id="comments"></textarea>
</div></td>
</tr>
<tr>
<td>
<div align="right">
<input name="newsletter" type="checkbox" id="newsletter" value="subscribeme" checked="checked" />
</div></td>
<td><span class="style24">
<span class="style19">
<label for="newsletter"><span class="style26">Subscribe to our FREE online Newsletter!</span></label>
</span>
<label for="newsletter"></label>
</span></td>
</tr>
</table>
</div>
<div id="apDiv24">
<table width="337" border="0" cellpadding="6">
<tr>
<td width="224"><div align="right">
<label for="clear"></label>

<input name="" type="reset" value="clear">
</div></td>
<td width="83"><div align="left">
<label for="send"></label>
<input type="submit" name="send" id="send" value="Send" />

</div></td>
</tr>
</table>
</div></form>

KTY
10-27-2009, 03:55 AM
edbr, do you mind if I send you my Dreamweaver file? Because I really don't know how to fix it :( tried again and preview it in Firefox, the clear button doesn't seem to work.

edbr
10-27-2009, 04:50 AM
copy the above ffrom into the body section and it will work i tested it

KTY
10-27-2009, 05:00 AM
hey it works now! Thanks million!!!

Corrosive
10-27-2009, 07:05 AM
hey it works now! Thanks million!!!

Ed just fixed what I told you to fix. He moved the closing form tag to the end of the form rather than having it in the middle. This indicates the start of a form <form> and this is the end </form>.

If some of your buttons come after the </form> tag then they are not part of the form so have no effect on the form. The clear button was correct but you had it outside of the form you were trying to clear...so it didn't work.

Does that make sense? You need to understand why as well as copying the code.