Jump to content
You're invited! Join our 4.6 Live Event on ZOOM 6/24 ×

Community

Hidden form elements still required


MrFisc
 Share

Recommended Posts

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.

Edited by MrFisc
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Edited by Marcher Technologies
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy