2 replies [Last post]
eZe616
eZe616's picture
Offline
Enthusiast
Aruba
Last seen: 12 years 51 weeks ago
Aruba
Timezone: GMT-5
Joined: 2007-02-23
Posts: 52
Points: 0

I've made this contact form, everything is positioned correctly, except the row of the Message+ textarea. For some reason, they won't be inside the label element. How can this be if the are wrapped into it within the html?

Here's the HTML code:

Contact Us form:

Name:


Last Name:

Email:

Message:
Hello




Here's the CSS code:

.textar { display: block;
clear: both;
border: 1px dotted #CCC;
border-bottom: 1px dotted #CCC;
padding: .35em 0em;
margin: 0em 0em .75em 0em;

}

#cont label textarea { width: 15em;
margin: .1em 0em;
display: block;
float: right;
padding: 0em;
margin: 0em;
margin-top: .25em;
font-family: Verdana;
font-size: 10px;
color: #666;
}

Let me know if more code is needed.

Here's the link of what I'm talking about http://eze.110mb.com/index.php?page=contact

The validator also tells me the 'name' attribute doesn't exist, but I'm sure it does with this doc type.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

You're simply not paying

You're simply not paying attention to containing your float elements, but I find your approach to these simple set of form elements confusing, why are you nesting a fieldset within another? and then grouping all the form elements in the inner?

With the 'for' attribute on labels you are meant to associate it to an ID on the input.

Quote:

The validator also tells me the 'name' attribute doesn't exist, but I'm sure it does with this doc type.

Smile How's that then? The validator informs you of the DTD it has tested against in either a big green or red heading and it matches the one you have used! so therefore 'name' can't exist in this circumstance?

'name' doesn't exist for the 'form' element it does out of necessity exist for the forms controls as it has a slightly different purpose from that of the old fragment identifier usage, remove 'name' on the form element and replace with an ID.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

eZe616
eZe616's picture
Offline
Enthusiast
Aruba
Last seen: 12 years 51 weeks ago
Aruba
Timezone: GMT-5
Joined: 2007-02-23
Posts: 52
Points: 0

Puttin the extra fieldset

Puttin the extra fieldset was the only way I could've gotten the form to be the way I wanted it. At the moment I didn't understand why, but it let the form be the way I wanted it for some reason. I'll try to revise the form.

As for the floated elements...How do you mean? Every element is floated the same, but separately the 'span' and 'input' element are each floated on their own and in their own label.