If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jul 2012
    Member #
    Hey guys, hope you can help me

    to cut the chase:
    I have a form, it has a form validation, if somethin is wrong with the input of the user (invalid characters or emptry field or invalid email format), my form would yeild an error

    now here is the thing

    I want that if an error occur, the browser would scroll to the field where the error occured.


    error on the email field, if so, on the next page load, after the validation, the user gets presented in front of the email field, so the user doesn't half to scroll down

    thank you in advance guys,

    more powers


  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Not from USA
    Member #
    2784 times
    emailfield.focus(); would do the trick in Javascript. There really isn't a way server-side that isn't awkward.

    However, you'll also have to run a check to make sure the user didn't already have his/her focus set because of a previous error in the event that (s)he makes multiple errors.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 11:11 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: