making html forms mandatory

PennController for IBEX Forums Support making html forms mandatory

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3636
    camRoRo
    Participant

    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 4 years, 11 months ago by camRoRo.
    #3638
    Jeremy
    Keymaster

    Hi,

    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

    #3639
    camRoRo
    Participant

    Hi Jeremy,

    got it. thanks a lot, it works now!

    #3646
    robpetrosino
    Participant

    Hi,

    I have put getHtml("name").test.complete() inside wait(), 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 for test.complete() anymore (I think there was in the earlier version of the site, but I can’t find anything there too).

    Thanks!

    #3648
    Jeremy
    Keymaster

    Hi,

    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 4 years, 11 months ago by Jeremy.
    #3650
    robpetrosino
    Participant

    Hi 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!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.