Solved

help with basic html/css layout issue

Posted on 2013-06-26
5
211 Views
Last Modified: 2013-07-23
Hello again

Please can you look at this form

http://www.docexdemo.com/retrofit/book-mot.php

If you don't fill in the form and click book mot at the bottom you will see error messages for the form. I have 3 basic  questions

1) why are the error messages showing up underneath the textboxes? They are supposed to be in a span tag which is directly after the textbox

e.g.

<tr><td class="td_pad5 w30 r s t">Registration</td><td class="td_pad5 l"><input type="text" id="vehicle_reg" name="vehicle_reg" class="details_input"/><span id="invalid_vehicle_reg" /></td></tr>

Open in new window


The error message goes in invalid_vehicle_reg

2) Why is the error message 'registration required' wrapping and not taking up the whole table cell width?

3) Why is the message 'you can login with this password...' about 20px below the password textbox. It is supposed to be directly below it as so

'<tr><td class="r td_pad5 s w30 t">Password</td><td class="l td_pad5"><input type="text" id="password" name="password" class="details_input"/><span id="invalid_password"/></td></tr><tr><td colspan="2">', $password_message, '</td></tr>';

Open in new window


The variable $password_message contains that text.

Thanks for your help
0
Comment
Question by:andieje
5 Comments
 
LVL 15

Expert Comment

by:Ess Kay
Comment Utility
1, if there is not enough room in the box, the errors will go to next line

2. the answer is in the css of the page, open chrome and do CTRL+i and go line by line to find out

3. the spacing in the css can be played with using method mentioned in answer #2
0
 
LVL 38

Expert Comment

by:Tom Beck
Comment Utility
The main problem is that you are using colspan="2" when there are actually 3 columns making up the full width of the row with the calendar in it. You have a 10px wide column between the calendar and time columns.

So, using colspan="3", your bottom table would look like this:

<table width="100%" align="center">
<tbody>
<tr>
<td colspan="3" class="tdh">Your Contact details</td>
</tr>
<tr>
<td class="r td_pad5 s w30 t">Name</td>
<td class="l td_pad5">
      <input type="text" class="details_input" name="name" id="name">
</td>
<td>
    <span id="invalid_name"></span>
</td>
</tr>
<tr>
<td class="r td_pad5 s w30 t">Phone</td>
<td class="l td_pad5">
      <input type="text" class="details_input" name="phone" id="phone">
</td>
<td>
    <span id="invalid_phone"></span>
</td>
</tr>
<tr>
<td class="r td_pad5 s w30 t">Email</td>
<td class="l td_pad5">
      <input type="text" class="details_input" name="customer_email" id="customer_email">
</td>
<td>
    <span id="invalid_customer_email"></span>
</td>
</tr>
<tr>
<td class="r td_pad5 s w30 t">Password</td>
<td class="l td_pad5">
      <input type="text" class="details_input" name="password" id="password">
</td>
<td>
    <span id="invalid_password"></span>
</td>
</tr>
<tr>
<td colspan="3"><br>You can login with this password to see your bookings</td>
</tr>
<tr>
<td colspan="3" class="tdh">Your vehicle</td>
</tr>
<tr>
<td class="td_pad5 w30 r s t">Registration</td>
<td class="td_pad5 l">
      <input type="text" class="details_input" name="vehicle_reg" id="vehicle_reg">
</td>
<td>
    <span id="invalid_vehicle_reg"></span></td>
</tr>
<tr>
<td class="td_pad5 w30 r s">Make</td>
<td class="td_pad5 l">
      <input type="text" class="details_input" name="make" id="make">
</td>
<td>
</td>
</tr>
<tr>
<td class="td_pad5 w30 r s">Model</td>
<td class="td_pad5 l">
      <input type="text" class="details_input" name="model" id="model">
</td>
<td>
</td>
</tr>
</tbody>
</table>

That will put the error messages to the right of the text boxes.
0
 
LVL 6

Accepted Solution

by:
lightspeedvt earned 500 total points
Comment Utility
To solve #1 and #2 add this CSS code to you 'css/style.css' file:
#invalid_name,
#invalid_phone,
#invalid_customer_email,
#invalid_password,
#invalid_vehicle_reg{
	position:absolute;
	margin-left:10px;
}

Open in new window


As for #3 - just do not do colspan="2". Instead of this add another <td>&nbsp;</td> before .
So you will have it:
<tr>
	<td>&nbsp;</td>
	<td>
	<br>
	You can login with this password to see your bookings
	</td>
</tr>

Open in new window

0
 

Author Comment

by:andieje
Comment Utility
Hi, i tried those solutions but they did not work.

The table containing the form is a nested table so I don't see how the number of columns in the outer table matters

The registration required message does not wrap in IE but it does in opera and others so it isn't that there isn;t enough space for the message.

Using position absolute for the error messages placed them above the text boxes on the the row below and not on the same row.
0
 
LVL 6

Expert Comment

by:lightspeedvt
Comment Utility
Can you add the position absolute to you styles and let us know to see what we are getting with it?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now