oTree Forum >

Multi-line (bounded) list input with sliders

#1 by AndreL

Good afternoon,

I want to implement a (single page) list input of a vector X of (x1..x10) inputs, one one each line, subject to the restriction that x1 >= x2 >= x3 ... >= x10.

I want to use slides for each line of the list, and bound the sliders such that the restriction is satisfeied. NUIslider can do that,  but the length of the sliders is the same for all 10 lines. 

Instead, I want that a slider for a lower row just cannot be dragged pasted the limit where the subject selected the slider (i.e. if subject put slider at "20" (out of 50) in row 1, the slider at row 2, still spanning 50, cannot be dragged right past 20.

Any suggestions of a snippet that accomplishes this?

 Kind regards,

#2 by Chris_oTree (edited )

I don't know how to do it with sliders, but here is a solution using RadioSelectHorizontal:

#3 by Chris_oTree

(note, for the HTML attachment, you should click 'view source' or save the file locally to see the javascript code inside it.)

Write a reply

Set forum username