Solved

help with basic html/css layout issue

Posted on 2013-06-26
5
217 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
ID: 39278641
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
ID: 39279080
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
ID: 39279621
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
ID: 39282394
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
ID: 39282422
Can you add the position absolute to you styles and let us know to see what we are getting with it?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS style formatting? 2 35
Allow a tab area under the contents 1 25
Calculating percentage 2 30
isNaN issue on the Table input text 2 4
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

726 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