Results 1 to 2 of 2

Thread: Problem With History() Function While Using Custom Scrollbar Script

  1. #1
    Join Date
    Jan 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem With History() Function While Using Custom Scrollbar Script

    1) Script Title: Slick Custom Scrollbar script v1.1

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex11/scrollc.htm


    3) Describe problem: I'm using your script with a radio button form on my website. The form is connected to a verification script that uses the "javascript:history.go(-1);" command to get back to the form with the user's input still intact. However, when this part of your script is added:

    Code:
    <script type='text/javascript'>
      
        $( document ).ready( function() {
            $( "div[rel='scrollcontent1']" ).customscroll( { direction: "vertical", bounce:0 } );
        });
         
    </script>
    the user input is not returned to the form. This input is vital to the functioning of the website (the form is a bit long & I would rather not force the user to reinsert all of their information again due to script malfunctions). If there is any way to modify the script to fix this issue PLEASE let me know what needs to be done and how.


    Thank you for your time in advance.


    P.S. Test form is located:

    http://education.requiescence-massag...croll_test.php


    * The verification program is invoked when AT LEAST one question is left unanswered before submission.
    Last edited by jscheuer1; 01-17-2015 at 05:18 AM. Reason: fix code tags

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Regardless of this script, javascript:history.go(-1); is an unreliable strategy for anything important because various browsers will react differently (if at all) when it's invoked. A better approach would be to set up your validation such that the browser never leaves the page that has the form on it until the form is considered valid. There are plenty of ways to do this. Google:

    form validation

    to find a selection of methods.

    Ultimately though, if this is a serious form, it will be being processed on the server side. If that's the case, you will want fall back validation done after submission to catch anything javascript missed, or in cases where there is no javascript active on the client machine. If you set that up, you will want the server to reload the form page preserving the valid data. This can all be done using SESSION or other methods (in PHP) or similar in other server side languages.

    Again, for anything important, one should never rely upon javascript:history.go(-1);

    It's no more reliable nor consistent cross browser than is the browser's BACK button, which behaves differently in different browsers and is inconsistent at times even in the same browser.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Slick Custom Scrollbar script - over scroll
    By jscheuer1 in forum Bug reports
    Replies: 3
    Last Post: 03-09-2012, 01:57 AM
  2. Slick Custom Scrollbar script - not working
    By blackshwak in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 12-11-2011, 03:06 AM
  3. Slick Custom Scrollbar script - does not work in IE
    By moal in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 11-22-2011, 07:26 AM
  4. Slick Custom Scrollbar script IE Issue
    By bkcreations in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 10-11-2011, 05:59 PM
  5. Problem with Custom Scrollbar.
    By CheetahMan in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 05-31-2007, 09:22 PM

Bookmarks

Posting Permissions

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