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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Location
    PA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry getting document.forms.submit() to refresh to different position on page

    I have code that I am working with that has a bunch of select statements that use onchange. I use onchange with the actual select statement and call a function that then calls document.forms['beltSelect'].submit();

    Also at the bottom of the page are a bunch of javascript if statements such as if ('<% response.write session("specificBelt") %>' != ''){ document.forms['beltSelect'].txtBeltSelector.value = '<% response.write session("specificBelt") %>';} This keeps the value of the different components on the form.

    My question is, is there a way to use what I have already, but when the select statement changes, have the page refresh to that same spot? Every time it submits now, it goes back to the top and the user has to scroll all the way down sometimes.

    Any help is greatly appreciated... Thanks

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Set focus to the combobox onload.
    Code:
    function scrollToSelect(){
      document.forms['beltSelect']['TargetSelectName'].focus();
    }
    ...
    <body onload="scrollToSelect();">
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New to the CF scene
    Join Date
    Aug 2005
    Location
    PA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you.. This has helped fix my problem.


  •  

    Posting Permissions

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