Search

Is there a way to make a field required only if another field is empty? Haven’t seen any extension enabling this either.

Specifically it would be useful to have fields for both email address and phone number, but only require one of them. Still both should be possible to fill out, so one combined field wouldn’t work (and would make value validation much harder).

Validation only ensures the format of an input is valid. It doesn’t authenticate what was entered. So the real purpose of making a field “required” is to remind someone that they failed to provide information that you want.

Could you do this checking in a save event? Like in the Save Comment event for instance? With this approach, though, you would not make the two fields required in the section definition. Instead you would just state that on your form.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details