cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
kelliganp
Nintex Newbie

Enable and Disable Buttons Conditionally

Jump to solution

I want to enable and disable buttons conditionally with form rules. Below is a screenshot of what I thought would work.

It the item is not signed (empty or null value in the PMApprover control), then I do not want the user to be able to click the submit button. As soon as the PMApprover control has data in it, I want the "Submit" button to light up.

Here is what is happening: When the form is opened, the PMApprover control is null and the submit button is disabled. This is expected.  When I click sign, the PMApprover control and the date control are populated but the button does not enable. The PMApprover control is connected top the list field "PM Approver". I have tried evaluating from the contents of the PMApprover control and the PM Approver list column without success.

Can anyone help?

Thanks and Regards,

Patrick Kelligan

Labels: (2)
Tags (2)
Reply
10 Replies
emha
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

you have to base your rule on control's value since field's value is only populated after you submit the form.

regarding of problem with the rule, can you post how do you set up PMApprover's value and what's its datatype?

Reply
achilles_aditya
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

I too had a similar issue with text box column but it worked in case of dropdown, I guess this is due to the fact that rule is applied at the first page load and after entering value in "PM Approver" the page doesn't refresh due to which the rule remains .Can u try adding validation rule to "Submit" to give error message when "PM Approver" is blank

Reply
kelliganp
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

Yes, I first set the condition against the list field and then it came to me that this would not work until after update of the list item. I then worked it against the control and still it did not work.

The PMApprover control is a text box

Reply
kelliganp
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

Hi aditya,

I checked it out and mine is behaving the same way. If I set condition against the drop down choice just above PMApprover (PMApproval), it works but I need to validate that a signature is loaded. I will try the validation rule on the submit button.

Thanks!

Reply
emha
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

ok.

then try to add to your javascript setter call like

NWF$('#' + PMApprover).focusout();
0 Kudos
Reply
kelliganp
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

Hi Marian,

I think your code line is working but now when I click the button, the page fully refreshes. Is that an expected behavior or is there a glitch in my code?

Thanks,

Patrick

//=============================;
//  PM Controls;
//=============================;

function signFormPM() {
    var curDate = new Date();
    NWF$('#'+ jsvar_PMDate).val((curDate.getMonth() + 1) + '/' + curDate.getDate() + '/' + curDate.getFullYear());
    NWF$('#'+ jsvar_PMName).val(NWF$('#'+ jsvar_CurUserPreferredName_CAL).val() +" (Current User)");
    NWF$('#' + PMApprover).focusout();
}
//----------------------------------------------------;
function resetSignaturePM() {
    NWF$('#'+ jsvar_PMAction).val("Please select an outcome...");
    NWF$('#'+ jsvar_PMDate).val("");
    NWF$('#'+ jsvar_PMName).val("");
    NWF$('#'+ jsvar_PMComment).val("");
    NWF$('#' + PMApprover).focusout();
}
0 Kudos
Reply
kelliganp
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

Hi aditya,

I was able to get some validation going on the control but is seems a little awkward and setting up multiple conditions is giving me headaches.

Thanks,

Patrick

Reply
emha
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

no, it shouldn't refresh.

haven't we discussed the same issue in some other thread? wasn't it one with disabled control that caused js variable was not defined?

so is PMApprover (or any of other referenced variables) valid variable within the scope of the code?

0 Kudos
Reply
kelliganp
Nintex Newbie

Re: Enable and Disable Buttons Conditionally

Jump to solution

Yes... whenever thee is an error in my code, the page refreshes when the function is called.

Reply