Register

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 3 of 3
  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    1
    Member #
    16938
    I built a page with a very long form. I am using spry validation to display when an invalid field has been submitted. When I click submit, the error messages display, but they cannot be seen from the location of the submit button at the bottom of the page.

    Q - Is there a way to get the user back to the top of the page when they click so they can see that there is an invalid field? All the fields with validation are in the first 5 fields.

    Thanks,
    CAL

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    I don't have an exact answer for you, but it looks like everything spry does
    is Javascripting. If you can find somewhere in the Javascript to add this ...

    window.scroll(0,0);

    BTW,
    This is the method used for a link within HTML:
    <a href="javascript:scroll(0,0)">
    Top
    </a>


  4. #3
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    I'd personally take a slightly different approach and would set the focus in the Javascript to whichever the offending field is (or the first offending field if there is more than one)...

    Code:
    document.form1.myfield.focus();
    ...that sort of thing.

    Sean


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 10:27 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com