Page 1 of 1

Dynamically set n_maxValue

PostPosted: Tue Apr 09, 2013 12:34 pm
by robhillis
I found this in the old forum but I am unsure of how to implement. I am new to JS.
http://www.softcomplex.com/forum/viewthread_4828/

Where does the following need to be placed?

o_slider.n_maxValue = n_someNewValue;
o_slider.n_pix2value = o_slider.n_pathLength / (o_slider.n_maxValue - o_slider.n_minValue);

Does that go in the JS file or does that go somewhere on the form?

thankyou!

Re: Dynamically set n_maxValue

PostPosted: Wed Apr 24, 2013 10:42 am
by tigra
The question was about changing the values dynamically (i.e. after the slider initialization)
This is the code that you call at any time to set the new values. This is likely going to be inside of your event handler.

Dynamically set n_maxValue

PostPosted: Mon Jun 22, 2015 9:40 pm
by LonnieUsem
Hello out there,

I got a JForm and I got some fields in there. I would like to disable a field, if the value of another field is "0". I know that I can do that by preparing the form while loading, but I want to solve that "live", so if the user clicks around, the readonly should immediately be set or unset.

How can I solve this? I guess I have to do some JQuery?

Re: Dynamically set n_maxValue

PostPosted: Thu Jul 16, 2015 12:04 pm
by tigra
You'll need to attach onchange event handler to the input element that you want to monitor (master) to be zero or not.
In that event handler you disable or enable dependent inputs (slaves) based on the new value of the master.

If master happens to be Tigra Slider Control then use onChange event of PRO version to monitor its state.
There's a sample for that: http://www.softcomplex.com/products/tig ... nmove.html