Agreement of conditions for form submission
This page is related to the devlopment of php forms.
As I discovered the composure of a form that checks both the entry of required inputs and the checking of
a "terms and condition" checkbox is not trivial.
If a check box being checked was the sole critiria for the form to be submitted, that would be easy.
What I was trying to
do was to allow the user to optionally check the
"consent", for the GDPR use of their information. The resulting submission would reflect a Yes or No.
The form had two checkboxes, the GDPR "consent" and the "terms and conditions" indcation that they had been read. For the second case I do have the code to make a first order attempt at determining whether the t's and c's had been read.
The first check is pretty straight-forward, the "check if read" is not so.
The logic on allowing the form to be submitted depending on the settings of the checkboxes was completed in the php code for the form in question, a booking form. However, the example (below) to check that the terms and conditions had at least been scrolled to the end did not seem to work on the Edge browser.
This seems to have been fixed - the code Math.round(this.scrollTop) was added to the MSN code
The allow on scrolling code
If you are like me you have seen this on many sites. It comes to mind that Apple are fond of this
technique.
Also DJI use this I think.
The MDN Example
Psychology of this technique
The adding of the text: enter anything in this box to confirm that you have read this agreement is pretty redundant as the form-filler will not see the text unless he/she had scrolled to it. If anything is entered makes no difference as the fact that it was read should be enough.
It does not mean that any of the other text was read only that the user scrolled to the end.