Howdy, Stranger!

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

Supported by

Required elements in HTML get ignored (plus overwriting screen resolution)

edited March 2022 in OSWeb

Hi there,

I'm setting up an experiment in OSWeb for the first time and most of it works flawlessly (the flow of the experiment and data collection run very smoothly). I've encountered two issues though:

1) All the required form elements (checkboxes, ratio buttons etc.) get ignored. I inserted "required" in the right places, but I can always submit the form without filling in anything.

Even in a simple example like this, selecting an option is not enforced:


<html>
<form>
<input type="radio" name="color" value="1" required>Option 1</input>
<input type="radio" name="color" value="2"> Option 2</input>
<input type="submit" value="Submit"></input>
</form>
</html>


2) The second issue is the placement of elements on the screen, which gets dictated by the screen resolution I define in OpenSesame itself. This leads to rather funky results in the browser. Can it be set to "auto" by default?

Thank you very much in advance!

Comments

  • Hi @ChrIm ,

    1) All the required form elements (checkboxes, ratio buttons etc.) get ignored. I inserted "required" in the right places, but I can always submit the form without filling in anything.

    Thanks for pointing out the required attribute. It simply isn't implemented, but since it's useful in many situations it makes sense to do so and I filed an issue for it.

    The second issue is the placement of elements on the screen, which gets dictated by the screen resolution I define in OpenSesame itself. This leads to rather funky results in the browser. Can it be set to "auto" by default?

    This is by design, so that the forms integrate visually with the experiment. However, since it's regular HTML, you can explicitly use a css3 style to change the appearance of the form. For example, this will make the form cover the entire window with a a red background:

    <div style="position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:red;">
    <input type='text' name='text_response'>
    <input type='submit' value='ok'>
    </div>
    

    — Sebastiaan

  • Thank you very much :D

Sign In or Register to comment.