danny
New Member
Posts: 3
|
Post by danny on Jul 1, 2021 9:15:09 GMT
Hi,
I am attempting to add a textline field with min/max and to be required as well. I've tried a few such combinations, but none seem to work as expected, either min/max is set or it is required, but not both at the same time (although it compiles ok in most cases). In practice, it allows not entering any value for a min/max textline filed.
Am I missing something?
I'd appreciate any insights on this.
See some attempted examples below:
l: age
t: textline
q: How old are you?
- {require}{min=18,max=100} Enter your age
l: age
t: textline
q: How old are you?
- {min=18,max=100}{require} Enter your age
l: age
t: textline
q: How old are you?
- {require,min=18,max=100} Enter your age
Thanks,
Danny
|
|
|
Post by PsyToolkit on Jul 8, 2021 13:14:31 GMT
Hi Danny,
This works perfectly fine:
l: age t: textline q: How old are you? - {require,min=18,max=100} Enter your age
I have no idea why it would not work. This way, it requires you to enter a number. I tried it and it works. Be more specific if it still does not work:
- Do you use the current PsyToolkit version? - What browser do you use (it should work on all browsers, but maybe you use something very unusual)?
|
|
danny
New Member
Posts: 3
|
Post by danny on Jul 13, 2021 9:48:37 GMT
Hi,
Ok, thanks, I now see that works ok.
As you see above, I attempted a few options, and some actually compiled ok but didn't work as expected.
Note that even for this option, now I see that the Continue button for that case is blue from the start and is not greyed out, so that is probably what confused me (I probably gave up at this stage, after the pervious attempts didn't work properly, i.e. allowed not entering any input, and continuing anyway). I now see it does however block continuing, and says I need to enter a value after I press the continue button (in other cases, it simply leaves the continue button greyed out and may not be pressed at all).
So this is actually ok in practice, although not quite consistent.
BTW, it may be worth more explicitly documenting this option (i.e. both require as well as min/max), regarding that it is supported, and the correct syntax.
Thanks, Danny
|
|