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

Making control disable not saving value after submission

Jump to solution

Hi

I am working on Nintex form. I have a Yes/No control  which depending on another field either gets selected or not.

I have used NWF$("#" + JSControl).attr("disabled", "disabled"); but when the form is submitted the value is not saved.

 

I have tried to use both the following :

 

NWF$('#' + JSControl).prop("readonly",true);

NWF$('#' + JSControl).attr('readonly',true);

 

which does not work on the Yes/No control but have tested it and works on text form box is there somthing l am missing for a Yes/No control.

 

I have even tried to put the Yes/No control into a panel and applied the rule to that also same issue when l submit the form the value is missing.

 

Any help would be greatly appreciated 

Labels: (1)
0 Kudos
Reply
14 Replies
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution
Maybe this thread helps you; https://community.nintex.com/t5/Nintex-for-SharePoint/Set-Checkboxes-to-Yes-based-on-two-conditions/...

NWF$('#' + JSControl).prop('checked',true);
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution

Sorry the issue is not with making the Yes/No control but when the form gets saved the values are not getting saved back the sharepoint list so the values are being lost. 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution
Just a quick check, you are using Nintex Forms 2013 with Classic Forms, right? I just did a quick test with a button that checks a simple Yes/No checkbox. The button executes the following function:

function CheckBox {
NWF$('#' + SimpleCheckBox).prop('checked',true);
}

I added a CSS-class to the 'Save and submit'-button, which enables me to submit the form through the function.

function CheckBox {
NWF$('#' + SimpleCheckBox).prop('checked',true);
NWF$('.SubmitCSSClass' input').click();
}

Can you share your full JavaScript so we can take a look at it?
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution

Hi Please see below :

 

Yes Nintex form 2013 , Classic forms

 

NWF$('#'+DropdownJS).change(function() {
var VarDropdownJS = NWF$('#'+DropdownJS).find("option:selected").text();
//Gets the value from the Client ID JavaScript variable name DropdownJS puts in into a variable 


if (VarDropdownJS!=("Please select a value...")
{
NWF$('#'+FreeFormJS).prop('checked',false);

NWF$('#'+FreeFormJS).val(VarDropdownJS);
}

else if (VarDropdownJS == "Business Company") {

NWF$("#" + YesNoJS).prop('checked',true);
NWF$("#" + YesNoJS).attr("disabled", "disabled"); } ##Issue is here l want to disable the Yes/No control if the dropdown is "Business Company" but when l submit the form the value does not save back to the sharepoint list its empty l have tried to use NWF$('#' + YesNoJS).prop("readonly",true); and NWF$('#' + YesNoJS).attr('readonly',true); but the Yes/No control is still changable.

 

Hope that clarifies things sorry if no

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution
I would suggest to just use the JavaScript to (un)check the Yes/No button, but use a rule to Disable the Checkbox when the Dropdown equals 'Business Company'. That should work!
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution

Thanks for your reply , that is the first way l tried but the rule was not applying so went with javascript

 

I added a rule to the Yes/No control marked as disable with the following condition :

 

YesNoNamedControlName == "Business Company"

 

but that had no affect on the Yes/No control

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution

I have added a screenshot that worked for me. I used the JavaScript as mentioned earlier to check the Yes/No box, but used the rule as shown in the image to disable it when the drop down value is 'Business Company'.

 

The rule is, as you can see, added to the 'Checkbox'. It checks the Drop Down value and, if that is 'Business Company', it disables the checkbox.

 

 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution

Yes did the same but not working for me.

Must be some other underlining issue with Nintex forms on my machine.

Thanks for your time.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Making control disable not saving value after submission

Jump to solution

Must be something to do with the Yes/No control

 

As both of the following :

 

NWF$('#' + JSControl).prop("readonly",true);

NWF$('#' + JSControl).attr('readonly',true);

 

work on free form control and the disable rule also works on a free form control.

This something about Yes/No control that noting works on it. I have tried to delete the control and re-create it same issue

0 Kudos
Reply