Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Link or no dice.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #4
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •