#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    13
    Rep Power
    0

    Jquery location.hash


    i used this code to create my form http://jsfiddle.net/Azxjt/
    how can i create the location.hash
    for example:
    im in the first part of the form
    www.example.com/form#step1
    if i click next
    i go to the next part of the form
    www.example.com/form#step2
    now i want to get back to the previous part of the form
    which is if i hit back on the browser
    i go to the previous form which is
    www.example.com/form#step1
    and all my inputs are still there
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,131
    Rep Power
    4304
    Here's an excellent jQuery plugin for doing that:
    http://benalman.com/projects/jquery-hashchange-plugin/

    Here's more information on it:
    https://www.google.com/search?q=java...State+popstate
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo