Jump to content

Member form helper


Adriano Faria

Recommended Posts

Posted

I'm testing a couple of plugins in 4.3.0 and the members fields shows up like that:

Rn3oPSs.png

This is the field.

$form->add( new \IPS\Helpers\Form\Member( 'followers_member', NULL, FALSE ) );

If I set it to be required, it shows "open". I believe this is happening due to the changes made on TAGs, which uses same classes somehow (JS, etc).

Obviously this is not the intended behaviour for the MEMBER field as my field cannot be required.

Can you confirm this is right or wrong? I mean, it will be this way now?

Testing a bit more, it seems that it had some change. I mean, even I choose GROUP above and submit the form, it won't stop even MEMBER being required. If it's like that now, then it's ok.

Can anyone confirm?

 

-- Beta 3 yet. --

Posted
1 minute ago, bfarber said:

Our form handler values() method explicitly ignores fields hidden due to toggles, so you should be able to set the member field required in this instance.

This is new in 4.3? I don't remember this before.

Posted
Just now, Adriano Faria said:

This is new in 4.3? I don't remember this before.

No, it's been there a while (I don't remember when it was added exactly). Keep in mind I haven't tested this specific scenario, but we've had issues in the past where a field would throw an error for some reason (required but not filled in, invalid value, etc.) but the field was hidden because it was toggled by another field, so the form just wouldn't submit and the user had no idea why. Thus, we added code in the values() method to ignore fields not currently visible.

  • 10 months later...
Posted
On 4/13/2018 at 10:30 AM, bfarber said:

No, it's been there a while (I don't remember when it was added exactly). Keep in mind I haven't tested this specific scenario, but we've had issues in the past where a field would throw an error for some reason (required but not filled in, invalid value, etc.) but the field was hidden because it was toggled by another field, so the form just wouldn't submit and the user had no idea why. Thus, we added code in the values() method to ignore fields not currently visible.

Brandon, have this changed on IPS 4.4? I have a required hidden field tied to a YES/NO and I got a error message when I submit the form without fill the field:

eqbWZUa.png

 

ZElW9Fp.png

Posted

Assuming you're just using the "required" parameter, no nothing changed. It should work the same as before. You can submit a ticket with a copy of the plugin for testing if it's not working.

Archived

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

  • Recently Browsing   0 members

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