Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-26-2010, 11:47 PM   PM User | #1
pageguy
New to the CF scene

 
Join Date: Jun 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
pageguy is an unknown quantity at this point
Form issue - cursor always on first input

I have a multipart form and while everything seems fine in IE (which I actually don't use except to check for cross browser compatibility) but there is an issue in FF and Chrome.

In those two browsers, when clicking on one of the form inputs it always puts the cursor back at the first form input.

Code:
	<div class= "formbox">
			<hr />
			<form action="editprofile.php" enctype="multipart/form-data" method="post" name="nameform" id="nameform" class= "formsection">
				<h3>Name</h3>
				<label>
					<span>First Name</span>
					<input name="firstname" type="text" class="formFields" id="firstname" value="<?php $firstname= stripslashes($firstname); $firstname= stripslashes($firstname); print "$firstname"; ?>" />
					<span>Middle Name</span>
					<input name="middlename" type="text" class="formFields" id="middlename" value="<?php $middlename= stripslashes($middlename); print "$middlename"; ?>" />
					<span>Last Name</span>
					<input name="lastname" type="text" class="formFields" id="lastname" value="<?php $lastname= stripslashes($lastname); print "$lastname"; ?>" />
					<span>Nick Name</span>
					<input name="nickname" type="text" class="formFields" id="nickname" value="<?php $nickname= stripslashes($nickname); print "$nickname"; ?>" />
					<input name="parse_var" type="hidden" value="name" />
				</label>
				<div class= "editsubmitbutton" id= "namesubmit">
					<input type="submit" name="button" class= "editsubmitbuttonlook" id="namebutton" value="Update Your Name" />
				</div>
			</form>
		</div>
So in this example, if you click on, say, lastname, the cursor immediately goes back to firstname. It works in IE though. And for dropdown menus (like birthday), which work in IE, it "clicks off" and doesnt keep the selection window open when you click to go through the menu like a typcal user would, making it impossible for any typical user to fill it out and extremely annoying for anyone else.

Anyone know why I have this problem and what I could do to fix it? Thanks.

Last edited by pageguy; 06-27-2010 at 12:29 AM..
pageguy is offline   Reply With Quote
Old 06-27-2010, 12:05 AM   PM User | #2
Apostropartheid
The Apostate


 
Apostropartheid's Avatar
 
Join Date: Oct 2007
Posts: 3,215
Thanks: 16
Thanked 265 Times in 263 Posts
Apostropartheid is on a distinguished road
Link or no dice.
__________________
Blog | Twitter
Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
Remember: no link, no code, no help!
Apostropartheid is offline   Reply With Quote
Old 06-27-2010, 12:14 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
I'm surprised IE doesn't do this either. Its the label. The label is meant to be linked to only one form input, not all of them like you did. Because you put the inputs in the label then clicking anywhere in the label will set focus to the first input. If you don't want this happening then put only one input per label. Here is how to use them properly.

http://www.456bereastreet.com/archiv...ms_accessible/
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 06-27-2010, 12:25 AM   PM User | #4
pageguy
New to the CF scene

 
Join Date: Jun 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
pageguy is an unknown quantity at this point
That makes too much sense! Can't believe I didn't think about it. I knew I was being naughty with the label anyway. Should have known it would coe back to haunt me. Will fix this and verify. Thanks.

-edit- Resolved!

Last edited by pageguy; 06-27-2010 at 12:28 AM..
pageguy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:24 PM.


Advertisement
Log in to turn off these ads.