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 8238659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:53:18+00:00 2026-06-07T19:53:18+00:00

I’ve got a problem with using javascript function inside Jquery. I want to get

  • 0

I’ve got a problem with using javascript function inside Jquery.
I want to get max and min value to the jquery SLIDER.
Please help.

Here is the markup.

$(document).ready(function() {

Here is the function MAX

    function getMax()
    {
             var options = document.getElementById('.price_range').childNodes;
                var min = 999999999;
                for(var i = 0; i < options.length; i++) {
                    if(options[i].value > max) max = options[i].value;
                }
                return max;
    }

Here is the function MIN

function getMin()
    { var options =document.getElementById('my_max').childNodes;
      var min = 999999999;

            for(var i = 0; i < options.length; i++) {
                        if(options[i].value < min) min = options[i].value;

            }
            return min;

    }

Here comes the slider function, it has to get min and max values from javascript functions

      // Slider
            $('#slider').slider({
                             range: true,
                            min: getMin(),
                            max: getMax(),
                            step: 10, // Use this determine the amount of each interval
                    values: [ 20, 40 ], // The default range
                    slide: function( event, ui ) {
                        $( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] ); // for input text box
                        $( "#my_min" ).val(ui.values[ 0 ]); // Display and selected the min Price
                        $( "#my_max" ).val(ui.values[ 1 ]); // Display and selected the max Price
                        }

            });
             //For dropdown box
    $( "#my_min" ).val($( "#slider" ).slider( "values", 0 ));
    $( "#my_max" ).val($( "#slider" ).slider( "values", 1 ));

         $("select.price_range").change(function () {
        $myMinValue = $("#my_min option:selected").val();
        $myMaxValue = $("#my_max option:selected").val();
        //Make changes on the slider itself
        if($myMinValue <= $myMaxValue) {
            $( "#slider" ).slider({
                values: [$myMinValue, $myMaxValue]
            });
        } else {
            alert("Invalid Input");
        }
    });


        });

and here is the index.html

  <body>

    <select id="my_min" class="price_range">
  <option value="0">0</option>
  <option value="10">10</option>
  <option value="20">20</option>
  <option value="30">30</option>
  <option value="40">40</option>
</select>
<select id="my_max" class="price_range">
  <option value="0">0</option>
  <option value="10">10</option>
  <option value="20">20</option>
  <option value="30">30</option>
  <option value="40">40</option>
</select

    ><!-- Slider -->
    <h2 class="demoHeaders">Slider</h2>
    <label for="amount">Price range:</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;">
  • 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-07T19:53:20+00:00Added an answer on June 7, 2026 at 7:53 pm

    Im not sure if i understand your problem fully,

    But calling a function using jquery is like this.

    $(document).ready(function() {
      var returnvalue = functionname();
    });
    

    Is this what your looking for?

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to construct a data frame in an Rcpp function, but when I
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.