gikeymarcia / Collector

A program for running psychology experiments on the web
32 stars 15 forks source link

duplicate input names must stop #102

Open gikeymarcia opened 9 years ago

gikeymarcia commented 9 years ago

on form submit look for duplicate input names without brackets and if they exist then stop experiment and tell participant to warn the experimenter. use experimenter email from settings.php

add them to done IP list

give verification code if applicable

TysonKerr commented 9 years ago

This would be helpful, except in a single case that I sometimes use for checkboxes. If you put a hidden input with the same name as a checkbox, you can make it appear that the form submits a different value for unchecked boxes. For example:

<input name="pageRefreshes" type="hidden"   value="noRefresh"    />
<input name="pageRefreshes" type="checkbox" value="hadToRefresh" /> I had to refresh the page

There are only some situations where this would be helpful, but when I have a list of checkbox options, I like to add these hidden unchecked values, just so that I can see that the form is working properly, and they didn't somehow skip this trial.

I suppose we could simply not apply this check to radios and checkboxes? Or perhaps hidden inputs?

TysonKerr commented 9 years ago

As discussed, the current plan is to check the trial on submit client-side, so that we can be absolutely sure that we didn't miss anything. If duplicate names are intentional, I'll add a class that exludes the input from this check. If the error catches something, it will cancel the submit and replace the form contents with an error message.