impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 175 forks source link

Form / Checkboxes / required - error #841

Open faqwecco opened 7 years ago

faqwecco commented 7 years ago

Created form added field with checkboxes made required. add 2 options (Yes / No). On frontend if submit form & choose NO - forms dsiplay warning that required field must be completed & highlight question in red

0406-form-required-error

jankus commented 7 years ago

Can you reproduce that on our live demo (www.impresspages.org/demo)?

TheFOBas commented 7 years ago

For chooses where you can only have single option selected you should use radio box.

What I suspect here is that you created custom for(not widget) and added 2 options where no has no value. Required validator will not allow an option with no value pass.

wombatslayer commented 6 years ago

Hello

I've had the same problem, using the stock standard form element.

jankus commented 6 years ago

Yes. This is a known issue and comes from a library that is used as default for from end validation. It doesn't recognize that there could be more than more control for the same input. If first value is selected, everything will be fine.

If a form is custom build (not via widget), you can (and should) do backend validation and throw errors where and when needed. In that case do not mark input as "Required" for frontend validation to skip it.