Solved

help with basic html/css layout issue

Posted on 2013-06-26
5
215 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
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.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

777 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