473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Form fields not working

Hi, I just updated one of my pages today to bring it into line with W3C standards (using their validator). And now....it doesn't work!!!

When you type in the first form field it works fine, and if you use TAB to move between the form fields it still works fine. But as soon as you try to use the mouse to move the cursor to the next form field it seems to kind of disable the form. Tried in Firefox (2.0.0.11) and Safari (3.0.4). Same in both.

Any wisdom on the problem greatly appreciated!
Here's my page (it's the login/register forms for the guestbook that don't work):
http://www.ffredjones.co.uk/main.php?page=guestbook

Thanks
Jan 6 '08 #1
5 4408
drhowarddrfine
7,435 Expert 4TB
Hi, I just updated one of my pages today to bring it into line with W3C standards (using their validator).
You may think you did but it isn't.
Jan 6 '08 #2
garrow
32
The reason you cannot click the form fields is that they are being obscured by the following box.

Try adding a background colour to the class .box and you'll see what I mean.
It will hide the forms.

[HTML]<div class="box text">
<div class="lft"/><div class="rgt"/>
<div style="clear: both; height: 1px;"> </div><br/>

<font class="textblack"><b>15/11/07</b></font><br/>
<font class="ffredtext">ffred_jones</font><font class="textblack"> wrote:<br/></font>
<font class="text">Hi, welcome to my website. Have a listen to my music and leave me a message or drop me a line on the contact page.<br/>
ffred<br/></font><br/><br/></div>[/HTML]


I would also use labels in forms to help aid usability, and increase the number of elements people can click to focus the form fields.

If you used the following code, clicking on the EMAIL label will focus the email form field also.
[HTML]<div style="display: block;" id="login"><br/>

<form method="post" target="main" action="guestbook.php">
<div style="float: left;">
<label for="login_email">Email:</label><br/><!--ADDED-->
<input type="text" value="" id="login_email" name="login_email"/>
</div>
<div style="float: left; position: relative; padding-left: 5px;">
<label for="login_password">Password:</label><br/><!--ADDED-->
<input type="password" name="login_password"/>
<div style="clear: left; height: 20px;"/><!--to make the enclosing div big enough for the button to go in it-->
<input type="submit" style="position: absolute; bottom: 0px; right: 0px;" value="Login"/>
</div>
<input type="hidden" value="1" name="login_submitted"/>
</form>
</div>[/HTML]

Also, the FONT element is deprecated, I would suggest using the semantic HTML where possible.

It is always easier to define a LABEL for a field, (by using the for attribute) than just throwing a span in there and styling the span.
You can then add styles to the label tag in your stylesheet.
Jan 7 '08 #3
Hi Garrow, thanks, that's definitely it. Now I might be being a bit stupid here, but I don't understand why the div below the forms covers up the forms. I've checked that I've got all the <div> tags nested and closed properly. So why does the div at the bottom move up to cover up the form fields above it? And it doesn't seem to cover up the words (or labels) "Email:" and "Password:". When you click the links which hide/show the forms the bottom div moves down, but only far enough to reveal the labels, not the form fields. I don't get it!!
Thanks
Jan 7 '08 #4
I see that drhowarddrfine was as helpful to you as he was to me. It sounds like you have to pay him to get any real advice.

Anyway, it looks like setting the .box class to { clear: both } will solve your problems. Your form elements our being floated to create the two column look. Then I think that the form or the containing div is not expanding to fill the total height and so the box is positioned too high and laid down on top of it. It works in IE, because IE lets you click through a transparent background whereas Firefox and Safari don't. Also you may want to use a margin-top instead of a padding-top on the .box class.

You might look at this page to clear the form without using another element: http://www.positioniseverything.net/easyclearing.html. However just using the .box element will work fine in this case. But if you ever want a background for the form you will want to use the method described in the link.
Jan 7 '08 #5
Yeah, that's fixed it. Thank you!

I'll have a little gander at that page, and another gander at my code to make sure that I really understand what's going on.
Cheers
Jan 7 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: TG | last post by:
I have a form that POSTs to itself and validates data entered into the form. If all is well the form performs a header location command to move to the next input form in the series. If the user has...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
6
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in...
2
by: devine | last post by:
Hi All, I am trying to send an automatic email when an update has been made. My update statement will updates 6 fields, and dependant on one of the fields, I would like to send an email using CDO....
2
by: Cerebral Believer | last post by:
Hi folks, Can anyone help me with this form: http://futurebydesign-music.com/_member/club_fbd_reg.php I have followed to coding instructions aas closely as I can, but I am getting errors...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
7
by: Perks | last post by:
Hi. I am trying to find out if it is possible to open a pdf file from within PHP, and parse its contents in order to extract all form fieldnames that might have been previously setup within the...
2
by: seltzer | last post by:
I am using Access 2000 but I also have the 2003 version. I am working on creating a data entry form in Access for a research study. Since there is a maximum of 255 fields per table in Access, I...
2
by: adwest | last post by:
Forgive me if this is a foolish question. I "play" in Access and have only created a few rather simple relational databases. My knowledge and experience is limited. I have no formal training, just...
45
by: dizzydangler | last post by:
Hi, I'm new to access (2007, running on XP), but I've gotten some great help from this site on my project so far. However, the more I know, the more complex the problems seem to become.... I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.