PennController for IBEX › Forums › Support › making html forms mandatory
- This topic has 5 replies, 3 voices, and was last updated 5 years, 3 months ago by robpetrosino.
-
AuthorPosts
-
May 10, 2019 at 5:15 am #3636camRoRoParticipant
Hi all,
before taking part in my experiment, i want participants to fill out a standard form stating their age and native language. I want them to have to fill it out before being able to continue with the experiment.
I tried doing it like this:PennController( "info1" , newHtml("info", "info2.html") .settings.log() .print() , newButton("info button", "weiter") .print() .wait( getTextInput("info1").testNot.text("") )
But it doesn’t let participants continue even if they have filled it out. Any thoughts on what I’m doing wrong here? Thanks a lot in advance!
- This topic was modified 5 years, 4 months ago by camRoRo.
May 10, 2019 at 8:33 am #3638JeremyKeymasterHi,
TL;DR: use getHtml("info").test.complete() inside the wait command instead (and make sure the textarea has the class obligatory in your HTML file).
In the script you pasted, there’s no TextInput element named info1 created at any point, so your command getTextInput("info1") doesn’t refer to anything. There is an Html element named info, and maybe the content of your file info2.html contains an input box, but that doesn’t make it a PennController element in your trial (let alone an element named info1). Whenever you use a get* command in the script of a trial, you should have a corresponding new* command somewhere in the same script.
Jeremy
May 13, 2019 at 4:34 am #3639camRoRoParticipantHi Jeremy,
got it. thanks a lot, it works now!
May 20, 2019 at 7:46 am #3646robpetrosinoParticipantHi,
I have put
getHtml("name").test.complete()
insidewait()
, but when I test the script and click on the button, the button gets greyed out and the script does not go through. I can’t seem to find the API reference fortest.complete()
anymore (I think there was in the earlier version of the site, but I can’t find anything there too).Thanks!
May 20, 2019 at 5:39 pm #3648JeremyKeymasterHi,
The documentation for test.complete can be found on the documentation here. When you want to look up a command for an element, go to its documentation page (in this case, the documentation page for the Html element). Or just use the search field on the top left corner of the website.
What you describe though sounds familiar. There was a bug like that in previous versions of PennController that I thought I had fixed in more recent versions. Which version of PennController are you using?
- This reply was modified 5 years, 3 months ago by Jeremy.
May 20, 2019 at 6:26 pm #3650robpetrosinoParticipantHi Jeremy,
my apologies – I must have updated the former version of PC. Now it works!
The documentation for test.complete can be found on the documentation here. When you want to look up a command for an element, go to its documentation page (in this case, the documentation page for the Html element). Or just use the search field on the top left corner of the website.
Weird – now the
test
method is there. Yesterday I couldn’t find it anywhere.Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.