Jump to content

Hidden form elements still required


MrFisc

Recommended Posts

Posted

If you have an element on a form that you mark as required, but then hide using a YesNo control, that element will still be required causing error messages such as the following:

"An invalid form control with name='mms_selected_pfield' is not focusable."

I'm looking into a temporary work around to fix this, however I would think it would make more sense to have IPS make un-mark elements as "Required" once they have been hidden on the form.

Posted
6 hours ago, opentype said:

Bug reports → Support Ticket
Feature requests → Feedback Forum

I'm not really sure what to call this though. I originally used the tag "Bug", but it's not really a bug, just the lack of a feature that could potentially cause a bug. I feel like it lies somewhere between the two.

Posted

You need to set required to false on the hidden element, then use the validation callback to validate it manually and conditionally - only when the YesNo is in the desired state.

Take a look at an \IPS\Node\Model's form() method for any app you own, they all tend to use this.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...