<legend> tags and forms

sfidirectory

Senior Member
Joined
Mar 29, 2010
Messages
931
Reaction score
504
Hi everyone,

Most of you might already know what I am about to say, so apologies if I sould like a broken record...

Anyway, I had my client email me today to say that his online forms weren't displaying (at all), but it was displaying on my end ok. I was using Firefox and everything worked ok, but upon testing it in Google Chrome I seen what he was talking about. It only took me 4 seconds to realise I forgot to close the "legend" tag properly. I guess Chrome renders web pages in a slightly different way. In case some of you don't know what a "legend" tag looks like, it is as follows:

Code:
<legend>Description goes here</legend>

Then your form's code
I also highly recommend enclosing all your forms code (including the "legend" tags etc) in "fieldset" tags. If you don't know what a "fieldset" tag looks like, here is an example:

Code:
[B][COLOR=Yellow]<fieldset>[/COLOR][/B]
<legend>Contact Us</legend>
<form name="contactform" method="post" action="send_form_email.php">
<table width="450px">
</tr>
<tr>
 <td valign="top">
  <label for="first_name">First Name *</label>
 </td>
 <td valign="top">
  <input  type="text" name="first_name" maxlength="50" size="30">
 </td>
</tr>
 
<tr>
 <td valign="top"">
  <label for="last_name">Last Name *</label>
 </td>
 <td valign="top">
  <input  type="text" name="last_name" maxlength="50" size="30">
 </td>
</tr>
<tr>
 <td valign="top">
  <label for="email">Email Address *</label>
 </td>
 <td valign="top">
  <input  type="text" name="email" maxlength="80" size="30">
 </td>
 
</tr>
<tr>
 <td valign="top">
  <label for="telephone">Telephone Number</label>
 </td>
 <td valign="top">
  <input  type="text" name="telephone" maxlength="30" size="30">
 </td>
</tr>
<tr>
 <td valign="top">
  <label for="comments">Comments *</label>
 </td>
 <td valign="top">
  <textarea  name="comments" maxlength="1000" cols="25" rows="6"></textarea>
 </td>
 
</tr>
<tr>
 <td colspan="2" style="text-align:center">
  <input type="submit" value="Submit">   <a href="[URL]http://www.freecontactform.com/email_form.php[/URL]">Email Form</a>
 </td>
</tr>
</table>
</form>


[B][COLOR=Yellow]</fieldset>[/COLOR][/B]
 
Back
Top