range type input in forms controller?

26 views
Skip to first unread message

psicom

unread,
Mar 25, 2021, 5:26:35 AM3/25/21
to ibexexperiments
Hi all,

Is there a specific reason why the form controller doesn't allow input of type 'range'? It seems to me that allowing that would provide an easy way to have multiple sliders at once (which is what I'm looking for). I tried extending the form controller with some simpleminded code (see below), but the slider positions don't get registered. 

thanks-Rick

        function handleClick(dom) {
            return function (e) {
...
                var slids = $(dom).find("input[type=range]");
                        for (var i = 0; i < slids.length; ++i) {
                            var slid = $(slids[i]);
                            rlines.push([["Field name", slid.attr('name')],
                                         ["Field value", slid.attr('value')]]);
                 }
 ...
}}               

Alexandre Cremers

unread,
Mar 25, 2021, 8:56:32 AM3/25/21
to ibexexp...@googlegroups.com
Hi Rick,

Not a direct answer to your question, but there's a Scale controller which is not documented but implements sliders as Ibex controllers (the files are present by default when you create a new experiment). You can stack more than one using a VBox.

If you're curious I also have a FastScale controller which probably won't work well if you put more than one on the same page, but allows you to present many sliders in quick succession.

All the best,
Alexandre

--
You received this message because you are subscribed to the Google Groups "ibexexperiments" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperimen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibexexperiments/f5f5fa17-eabe-47cf-959e-74d3397bbe7bn%40googlegroups.com.

Alex Drummond

unread,
Mar 25, 2021, 9:23:29 AM3/25/21
to ibexexperiments
Thanks Alexandre. Rick: there is no particular reason for not
supporting range inputs. I am currently working more on the Ibex Farm
than on the code for Ibex controllers. However, a PR to add this
functionality would certainly be welcome over at
https://github.com/addrummond/ibex, if anyone wants to have a go.
Alex
> To view this discussion on the web visit https://groups.google.com/d/msgid/ibexexperiments/CABk4Z5eK0pB-gRENU%3DhHD6TKZem-OjN%3DwFkDyAKqovOXRX9KoA%40mail.gmail.com.

psicom

unread,
Mar 25, 2021, 10:36:00 AM3/25/21
to ibexexperiments
Thanks Alexandre and Alex. 
@Alexandre: Yes, I know about these options, but I am slightly daunted by the VBox thing - and hoped using forms would be easier. But I'll bite the bullet...
(Didn't know about FastScale. I'll check it out).

Message has been deleted

psicom

unread,
Mar 25, 2021, 5:17:16 PM3/25/21
to ibexexperiments
For the record / for what it's worth: I discovered that I made a silly mistake of adding the code for the range type input after the line "t.finishedCallback(rlines);" which is why the result weren't recorded. So indeed there is no problem using range inputs. The attached minimally modified form controller works as I want it to work. See e.g. this setup .
R

Formica_js.txt
Reply all
Reply to author
Forward
0 new messages