Conditionally disable button

rss

Posted by Katy - Dec 16 ’16 at 10:56

 

I am trying to make a button disable when the status field is Completed, I found this tread :

http://forum.spform.com/forms-designer-for-sharepoint-20/button-disable-and-enable-27284/

and here is my code:

 

function ButtonDisable() {
if (fd.field('Satus').value() == 'Completed') {

$('.approve-button').prop('disabled', true);
} else {

$('.approve-button').prop('disabled', false);
}
}
fd.field('Satus').change(ButtonDisable);
ButtonDisable();

but it is not working L

 

 

 

  • YuriyMedvedev
    Moderator
    Member for: 5 years 1 month
    #1 by YuriyMedvedev Dec 19 ’16 at 08:24

    Hi, use this code

    function ButtonDisable() {

    $('.approve-button').prop('disabled',

    (fd.field('Title').value() != 'Completed'));

    }

    fd.field('Title').change(ButtonDisable);

    ButtonDisable();

  • Katy
    Member
    Member for: 7 years 3 months 11 days
    #2 by Katy Dec 19 ’16 at 09:25

    [#1]: Thanks Yuriy! It works. Just changed != to ==, as it was disabling the buttons when the status is not completed :-)

  • EthanEtheridge
    Member
    Member for: 1 month 20 days
    #3 by EthanEtheridge Sep 7 ’21 at 03:29

    When using the window, your plug is very useful. In addition to this post, you would have never reached this site without it. This is a great post and a great creation and students can check lawteacher review to get the best paper services. It's a pleasure to see your work. Your efforts are appreciated.

  • kayleebrown402
    Member
    Member for: 1 month 18 days
    #4 by kayleebrown402 Sep 8 ’21 at 08:39

    Computer programming and programming languages are tough to decode sometimes. If you are not a pro, it will be tough for you to handle computer programming and all the assignments related to it. If you are a beginner and you are just learning the basics, you might require an expert’s help to finish your assignment on time. Make sure you take programming assignment help from a coding expert. If you search online, you can locate someone in your locality. An experienced coder can finish the assignment on time and with clarity. You have to submit the assignment on time as the marks are associated with it.

  • alvina adolf
    Member
    Member for: 4 months 24 days
    #5 by alvina adolf Sep 16 ’21 at 07:25

    Students who are searching for a writing service you must take help from Assignment Bank. It is one of the best platforms for students to take online writing assistance. With the assistance of qualified writers, the assignment writing process becomes very easy for the students and they can easily finish the assignments without any worry. One should invest in the online writing service given by this platform and you will have access to many modern features which you won't get anywhere else. We have secure payment options on our website and you will get plagiarism-free assignments. We have been working for years for the benefit of students and we will continue to offer to research paper help UK service and TEFL Assignment help online to the students. Take our writing help for finishing your assignments without any delay.

Displaying 1 to 5 of 5 messages