Jump to content
J_Szwarga

Need for a InputfieldSubmit->disable() call?

Recommended Posts

Can't find any reference to a disable() method on the InputfieldSubmit field type...wondering if I should submit a PR to add this method as I'm just getting into using a bunch of inputfields on some process modules and have a need for this. The method would simply add the "disabled" attribute to the button, and add the class "ui-state-disabled", but having a nice disable() method to wrap that up would be something that everyone could use if it were built-in?

I just hesitate to do a PR because I may be missing something, since surely if this was wanted it would have been put in by now??

 

Share this post


Link to post
Share on other sites
5 hours ago, J_Szwarga said:

The method would simply add the "disabled" attribute to the button, and add the class "ui-state-disabled"

This is already possible with two lines of code, so I don't think a dedicated method is needed.

$s = $modules->get('InputfieldSubmit');
$s->attr('disabled', true);
$s->addClass('ui-state-disabled');

 

  • Like 1

Share this post


Link to post
Share on other sites

That is true, but they do require looking up the class name if you don't already know it. 

I noticed that InputfieldSubmit already has setSmall() (only 1 line of code) and setSecondary().

setDisabled() seemed like it would be consistent with these, just saying.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...