Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Inline_html and logging variables

Hi!

I'm doing an experiment with OpenSesame and I'll upload it to mindprobe.

As far as I know, I can't use forms with OSWeb, so I used inline_html to ask for Age and other variables.

I attach the script I'm using to ask for age. Before this inline_html, I included an inline_javascript to start the variable age (vars.age = ' '). Then, in the logger, I could include this variable.

When I did the experiment, the script worked and I could enter "age". However, when I got the results, the column age is empty.

I don't know what the problem is. I hope you can help. Thank you.

Best,

Teresa


Comments

  • Hi @T_Q,

    The solution is actually quite simple and is available in the documentation here:

    There you find the following description:

    "The  attribute of  tags corresponds to an experimental variable. Therefore, the text that is entered into the text input of Example 1 will be stored as the experimental variable ."

    For example, in this very basic text input...

    <input type='text' name='text_response'>
    <input type='submit' value='click here to continue'>
    

    ...you can see that the text input object has a name attribute: text_response. This ensures that the content of the text inputted by the user is thereafter stored in vars.text_response.

    I made a basic example taking requesting the user to imput their age to demonstrate it:

    You just have to add a name parameter as part of your <input id="ageinput" type="number"...> line of code.

    Best,

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab !

    Thank you for your message, and I apologize for cross-posting. I wasn’t sure if I would receive a response in the OSWeb forum, so I also posted in OpenSesame :/

  • Hi @T_Q,

    No worries!

    Glad I could help and that the task is now working!

    Best,

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.