PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Jquery UI Slider on multi-page forms

  1. I've already replied to an existing, related post last week but haven't received any guidance.

    http://www.gravityhelp.com/forums/topic/jquery-slider-field

    What is the best method for making the ui slider values persist across multi-page forms? Whenever I change pages their values get reset to the default.

    Thanks,

    Don...

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  2. David Peralty

    So you are trying to use what basically constitutes a slider inside a slider? Do you have a link to your form?

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  3. Thanks for the reply David.

    the form is here: http://agencyzed.com/cloudassessment/?page_id=2

    Not a slider inside a slider. just multiple sliders on different pages.

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  4. David Peralty

    Ah, I see what you are talking about not. I'll check with the team on this.

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  5. Thanks David.

    I have another question in this same project. In order to take the assessment, the user needs to be logged in. Once logged in, they can take the assessment a number of times.

    Once they log in, I'd like to show them a page which lists all of their assessments.

    I know Gravity stores submission in the wordpress database but what is the best method of accessing the information based on the current user?

    If this should be pasted as a separate support topic, let me know and I'll open one.

    Cheers,

    Don...

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  6. David Peralty

    Yes, if you could copy and paste this into its own, that'd be great as one of the developers will probably respond to your first issue, and it will take a bit to go through this and I don't want to confuse the conversation streams.

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  7. Hi Donaker,

    Give this code a try:

    http://pastie.org/3910824

    Two significant difference.

    1 - We check if the input already has a value. If it does, we use that. Otherwise we set the default value you had specified.

    [js]
    var value = $("#input_1_38").val() ? $("#input_1_38").val() : 30.5;

    2 - In order to set the input value when the slider is originally created, we take advantage of the the "create" method, which uses the same code as the "slide" method.

    Hope that helps! :)

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  8. This isn't working for me. The filed which holds the slider value now starts out blank instead of having the default value in it. Once I move the slider, a value appears as expected. Also on submission, the field is not written to the database.

    If I hit next page and then hit previous page, the field appears blank instead of having the value selected when the slider was moved.

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  9. Hi Donaker,

    It looks like the issue is that on the create event, the UI object does not have a value. To get around this, you can pass the "value" variable we created about the script init.

    http://pastie.org/3912118

    Posted 11 years ago on Monday May 14, 2012 | Permalink
  10. That did the trick.

    Thanks David!

    Posted 11 years ago on Monday May 14, 2012 | Permalink