...

View Full Version : IE display problem



Dan06
11-25-2008, 05:38 PM
I have a form that is validated upon submission and if there are any errors a label error is shown.

The problem only occurs when there is an error in the nested fieldset. The label errors are supposed to show next to the input field. However, when, and only when, there is an error in the nested fieldset, the subsequent label errors, when shown, are displayed under the input field label rather then next to the input field itself.

The above error only occurs in IE. In firefox, regardless of where/when the errors occur - in the nested fieldset or not - the labels are correctly displayed.

Below are my css and html code, if some can tell me how to fix the problem so that IE shows the label errors correctly in all situation, it would be appreciated. Thanks.


form.registration {
margin-bottom: 10px;
}

form.registration legend {
padding: 0 2px;
font-weight: bold;
color:#FF6600;
}

form.registration label {
display: inline-block;
line-height: 1.8;
vertical-align: top;
}
form.registration fieldset ol {
margin: 0;
padding: 0;
}
form.registration fieldset li {
list-style: none;
padding: 5px;
margin: 0;
}
form.registration fieldset fieldset {
border: none;
margin: 3px 0 0;
}
form.registration fieldset fieldset legend {
margin-left: -10px;
padding: 0 0 5px;
font-weight: normal;
color:#000000;
}
form.registration fieldset fieldset label {
display: block;
width: auto;
}
form.registration em {
font-weight: bold;
font-style: normal;
color: #f00;
}
form.registration label {
width: 160px; /* Width of labels */
}
form.registration fieldset fieldset label {
margin-left: 150px;
}

label.error{
background: transparent url(images/cancel.png) no-repeat scroll left;
font-weight:normal;
color:red;
text-align:left;
width:140px;
padding-left:25px;
display:inline;
}




<fieldset>
<legend>Registration</legend>
<ol>
<li>
<label for="firstName">First Name<em>*</em></label><input type="text" name="firstName" id="firstName"/>
<label class="error" for="firstName" id="firstNameError"></label>
</li>
<li>
<label for="lastName">Last Name<em>*</em></label><input type="text" name="lastName" id="lastName" />
<label class="error" for="lastName" id="lastNameError"></label>
</li>
<fieldset>
<legend>Domestic or International?<em>*</em></legend>
<label class="error" for="memberType" id="memberTypeError">This field is required.</label>
<label><input type="radio" name="memberType" id="domestic" value="domestic"/>Domestic</label>
<label><input type="radio" name="memberType" id="international" value="international" />International </label>
</fieldset>
<li>
<label for="email">Email<em>*</em></label><input type="text" name="email" id="email" />
<label class="error" for="email" id="emailError"></label>
</li>
<li>
<label for="password">Password<em>*</em></label><input type="password" name="password" id="password" />
<label class="error" for="password" id="passwordError"></label>
</li>
<li>
<label for="confirmPassword">Confirm Password<em>*</em></label><input type="password" name="confirmPassword" id="confirmPassword" />
<label class="error" for="confirmPassword" id="confirmPasswordError"></label>
</li>
<center><p><input type="submit" name="signUp" value="Sign-Up"/></p></center>
</ol>
</fieldset>

abduraooft
11-26-2008, 08:30 AM
Can we have a link to your page ot the complete markup, including DOCTYPE.

Dan06
11-26-2008, 07:39 PM
Attached is the complete page. Note: I did use jQuery for some of the code.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum