Linking user input directly to formfield

30 views
Skip to first unread message

Ryan

unread,
Nov 29, 2021, 6:38:00 AM11/29/21
to oTree help & discussion
Hello all, 

I want to link input generated via user interaction with a chart to an input field. Here is a working jsfiddle as an example: https://jsfiddle.net/BlackLabel/3zwdsfq4/  . You should notice int he fiddle that dragging the high/low ends of the columnrange point (shaded red area) causes the two input fields to update dynamically. 

However, the solution in the working fiddle that I've linked does not work in oTree and I don't understand why. Instead, I just get blank input fields in oTree that are not linked to user-generated input via interaction with the high/low values of the columnrange point. 


Does anyone know what might cause the solution in the fiddle to not work in oTree? Does anyone know of a way to achieve in oTree what I have achieved in the fiddle? 


cheers, 

Ryan 

Chris @ oTree

unread,
Nov 29, 2021, 9:23:58 AM11/29/21
to Ryan, oTree help & discussion
Are there any errors in your browser’s JavaScript console?

Otherwise, use console.log() to see whether your functions get executed and whether your variables such as columnRangePoint have the value you expect. 

Sent from my phone

On Nov 29, 2021, at 3:38 AM, Ryan <ryan....@economics.ox.ac.uk> wrote:

Hello all, 
--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/83ff73a0-d0a9-4ea0-9977-31d6f1748d1en%40googlegroups.com.

Ryan

unread,
Nov 29, 2021, 2:19:58 PM11/29/21
to oTree help & discussion
Chris, 

The only thing I see in the Javascript console that might an issue is the following message: "Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute" ... I do not receive the same message when running this code using the linked fiddle. 

Any thoughts? 

Chris @ oTree

unread,
Nov 29, 2021, 2:32:54 PM11/29/21
to Ryan, oTree help & discussion
You can ignore that. 

Sent from my phone

On Nov 29, 2021, at 11:20 AM, Ryan <ryan....@economics.ox.ac.uk> wrote:

Chris, 
Reply all
Reply to author
Forward
0 new messages