Hello, all.
I am currently working on a contact form that uses Javascript for field validation, before displaying an 'errors' span that will be populated with a
<p> tag explaining what went wrong. This is what my contact form looks like:
CODE
<div id='responseInfo'>
<fieldset>
<span></span>
<label for='cName'>Name:</label>
<input id='cName' name='cName' /><br />
<label for='e-mail'>E-mail Address:</label>
<input id='e-mail' name='e-mail' /><br />
</fieldset>
</div>
And this is the CSS applied to it:
CODE
div#content div {margin:5px;display:block}
div#content fieldset {float:left;padding:10px;}
div#content br {clear:left}
div#content label,input,textarea {float:left;width:150px}
div#content label {text-align: right;width:100px;padding-right:15px;margin-bottom:10px}
div#content span {background:#f08080;border:1px solid #B22222;padding:1px;margin:5px 0px 5px 0px;display:block;visibility:hidden}
div#content span p {text-align: center;float:none;width:100%;font:90% arial}
When the form is submitted, the Javascript will quickly check all of the inputs and see if they have values. If they don't, the
<span> will have its
visibility attribute changed to 'visible', and the users will be able to see what went wrong. However, under Firefox the span doesn't seem to be filling the full width of the
<fieldset> that it's inside of. Does anyone know what might be going wrong?
You can see the problem occuring
here(link changed - problem is resolved), if you enter nothing in the e-mail or comments field before submitting the form(must have javascript enabled).
Edit: After a bit more testing, I've also discovered that the spans are at 100% of the body width under IE6. I'd like to fix this too.
This post has been edited by girasquid: 20 Jun, 2007 - 07:38 PM