When I click sumbit on the form found here:
http://test-bed.co.uk/garden/book.php
The validation messages don’t appear as desired, I would like them to appear alongside the input elements as if they were inline.
I believe the label or input styling rules could be causing the problem. As they are floated the containg div with an id of form is floated left.
#aform label {
clear: both;
display: block;
float: left;
font-weight: bold;
text-align: left;
}
.inputstyle2 {
float: left;
margin-right: 240px;
width: 300px;
}
#form {
float: left;
}
Any suggestions and explanations of what I have done wrong would be much appreciated.
First you need to remove
margin-rightand addclear: bothwithin.inputstyle2:The error labels will still be placed underneath the input field as they inherit
clear: bothin#aForm labelwhich is removing the float effect. Thankfully you can override this by using a more specific CSS selector and removing theclear: