Required field ignored

fl flodariege 10 May, 2018
Hello,
​
I am currently trying to add a checkbox in order to meet the GPDR regulation, but the form is being validated even if this checkbox is not checked.
I had a look here : https://www.chronoengine.com/forums/posts/t100765/form-can-be-submitted-without-a-required-field?keywords=REQUIRED%20FIELD
and I tried to add autocomplete=off which did not change anything.
Weirdly, I have other required fields that work perfectly.
I am almost sure I am simply missing something, but what???
See the fiel configuration here :
Required field ignored image 1
Required field ignored image 2
Required field ignored image 3
Required field ignored image 4
​
And you can test the form here :
http://www.rouchenergies.fr/devis-gratuit.html
​
I use Chrome.
I tried with autocompletion, and without it: same bad result ;(
​
Thank you for any help.
​
Best regards,
FlodAriege
France
Gr GreyHead 11 May, 2018
Hi FlodAriege,
​
You have a JavaScript error on the form page from some code in your template. If you resolve that then the validation should work OK. You may want to set a ghost value for the CheckBox to make sure that you can positively check the value after submission.
​
Bob
fl flodariege 11 May, 2018
Hi GreyHead,
​
Ooooh... I am already working on this error with the template's editor. I did not realize it could prevent this required field to work.
May I ask you another question?
What is exactly a "ghost value"? (in french this does not mean nothing for me, sorry)
​
My other required fields work perfectly: maybe I should try to turn this checkbox into something else (dropdown or so) waiting for joomlashine to solve the JavaScript issue...
​
Thank you.
Gr GreyHead 11 May, 2018
Hi flodariege,
​
By default an 'unchecked' checkbox returns nothing at all when the form is submitted. If you set a ghost value then that will be returned when the form is submitted. It makes it a bit easier if you know that there is always a value submitted rather than having to check for an entry 'missing' from the submitted data.
​
Bob
This topic is locked and no more replies can be posted.