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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:59:27+00:00 2026-06-04T13:59:27+00:00

I have a set of inputs and for each value that I’m inputting I

  • 0

I have a set of inputs and for each value that I’m inputting I have a “range” slider and a “number” input. I have a little bit of JS that is called by both the slider and the number field using the onchange=”send(input_id, input_kind, this.value)” attribute for each input.
If the slider moved I update the number and if the number changed I update the slider.

This is fine for the slider as as soon as one moves it, the number starts tracking along. When one adjusts the number with the little up/down arrows or types numbers the slider does not update. The JS is not called until another field is selected, i.e.. the input loses focus then it passes it’s data to me bind{k, d, v} function.

HTML:

            <div class="number-pair">
                <sub-title>X-Position</sub-title><br />
                <input id="/layout/1/slider" class="slider" type="range" value="0" min="-1" max="1" step="0.01" onchange="bind('/layout/1', 'slider', parseFloat(this.value))" />
                <input id="/layout/1/number" class="number-box" type="number" value="0" min="-1" max="1" step="0.01" onchange="bind('/layout/1', 'number', parseFloat(this.value))" /><br />    
            </div>

JS:

        function bind(id, control, v)
        { 
            if (control=="slider")
            {
            if (console) console.log("It's a slider");
                e = document.getElementById("/layout/1/number");
                if (e)
                {
                    e.value = v;
                }
            } else if (control=="number")
            {
            if (console) console.log("It's a float");                   
                e = document.getElementById("/layout/1/slider");
                if (e)
                {
                    e.value = v;
                }
            }
        }

How can I get a more responsive binding for using number arrows?

N.B. I’m not just binding the two inputs to each other but to on-screen effects elsewhere so move responsive binding is desirable in that context not just the slider which I could live with.
Also I’m using literals to find update the paired value in my JS but literals will be replaced with a dynamic expression so I can bind a whole range of slider/text number input pairs.

  • 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-04T13:59:28+00:00Added an answer on June 4, 2026 at 1:59 pm

    On the input fields, bind to the onkeypress, rather than the onchange event, because the onchange event isn’t called until the control loses focus. To trap arrow presses, bind to the onclick event.

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

Sidebar

Related Questions

I have an input field that is by default set to type=text so that
I have been trying to set the value of a hidden input by using
I have a set of select inputs representing a users birthday: birthyear, birthmonth and
I have set my default-input-method variable to english-dvorak: (custom-set-variables '(default-input-method english-dvorak)) When I launch
In my form I have a set of input boxes where a user can
We have some examples of pictures. And we have on input set of pictures.
I have an arraylist set up. I have input instuctions set up too, so
I have a table that contains multiple rows. Each row contains 5 columns (or
I have a set of radio buttons that are for certain products. I am
In an XForms form, I have a section that repeats with inputs inside of

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.