472,965 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 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 4395
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.