making html forms mandatory

PennController for IBEX Forums Support making html forms mandatory

This topic contains 5 replies, has 3 voices, and was last updated by Avatar robpetrosino 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3636
    Avatar
    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 3 months, 2 weeks ago by Avatar camRoRo.
    #3638
    Jeremy
    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
    Avatar
    camRoRo
    Participant

    Hi Jeremy,

    got it. thanks a lot, it works now!

    #3646
    Avatar
    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
    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 3 months ago by Jeremy Jeremy.
    #3650
    Avatar
    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.