Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8774279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:31:28+00:00 2026-06-13T18:31:28+00:00

I’m trying to pass form slider values between pages so that the changed settings

  • 0

I’m trying to pass form slider values between pages so that the changed settings can be used in the target page. For that I’m just accessing the DOM on the same page as explained in the answer here.

Here is my sample code:

<!DOCTYPE html>
<html>    
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Multi-page template</title>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

        <script>
            $(document).on('pageinit', '#review', function() {
                $('form').submit(function() {
                    first_count = $('#first_slider').val();
                    second_count = $('#second_slider').val();
                    $.mobile.changePage('#front');
                    return false;
                });
            });
            $(document).on('pageinit', '#front', function() {

                $('#first_count').text('' + first_count);
                $('#second_count').text('' + second_count);

            });
        </script>
    </head>
    <body>

        <!-- ======================== -->
        <div data-role="page" id="review" data-theme="a">

            <div data-role="header">
                <h1>Review</h1>
            </div>
            <p>
                Review content
            </p>

            <div data-role="content" data-theme="a">
                <form>
                    <label for="first_slider">First:</label>
                    <input type="range" id="first_slider" value="60" min="0" max="100" />
                    <label for="second_slider">Second:</label>
                    <input type="range" id="second_slider" value="60" min="0" max="100" />
                    <input type="submit" value="Submit" />
                </form>
            </div>

        </div>

        <!-- ======================== -->
        <div data-role="page" id="front" data-theme="a">

            <div data-role="header">
                <h1>Front</h1>
            </div>

            <div data-role="content" data-theme="a">
                <p>
                    Front content
                </p>

                <p id='first_count'></p>
                <p id='second_count'></p>

                <p>
                    <a href="#review" data-role="button">Main</a>
                </p>
            </div>
        </div>
    </body>
</html>

This seems to work the first time and the changed setting would show on the ‘front’ page, but not on subsequent page calls. I tried other JQM page events than ‘pageinit’ but can’t get this to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:31:29+00:00Added an answer on June 13, 2026 at 6:31 pm

    I played around with your example and got it working. I used this info from the docu

    Form buttons

    For ease of styling, the framework automatically converts any button
    or input element with a type of submit, reset, or button into a custom
    styled button — there is no need to add the data-role=”button”
    attribute. However, if needed, you can directly call the button plugin
    on any selector, just like any jQuery plugin:

     $('[type="submit"]').button();
    

    which results in this script

    <script>
        $('[type="submit"]').bind( "click", function() {
          first_count = $('#first_slider').val();
          second_count = $('#second_slider').val();
          $('#first_count').text('' + first_count);
          $('#second_count').text('' + second_count);
          $.mobile.changePage('#front');
          return false;
        });
    </script>
    

    complete corrected version of your example:

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>Multi-page template</title>
      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
      <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
    </head>
    
    <body>
      <div data-role="page" id="review" data-theme="a">
        <div data-role="header">
          <h1>Review</h1>
        </div>
        <p>
          Review content
        </p>
    
        <div data-role="content" data-theme="a">
          <form>
            <label for="first_slider">First:</label>
            <input type="range" id="first_slider" value="60" min="0" max="100" />
            <label for="second_slider">Second:</label>
            <input type="range" id="second_slider" value="60" min="0" max="100" />
            <input type="submit" value="Submit" />
          </form>
        </div>
      </div>
    
      <!-- ======================== -->
      <div data-role="page" id="front" data-theme="a">
        <div data-role="header">
          <h1>Front</h1>
        </div>
    
        <div data-role="content" data-theme="a">
          <p>
            Front content
          </p>
    
          <p id='first_count'></p>
          <p id='second_count'></p>
    
          <p>
            <a href="#review" data-role="button">Main</a>
          </p>
        </div>
    
        <script>
          $(document).bind('pageinit');
        </script>
      </div>
    
      <script>
        $('[type="submit"]').bind( "click", function() {
          first_count = $('#first_slider').val();
          second_count = $('#second_slider').val();
          $('#first_count').text('' + first_count);
          $('#second_count').text('' + second_count);
          $.mobile.changePage('#front');
          return false;
        });
      </script>
    </body>
    </html>
    

    screenshot
    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.