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

Enable/Disable Lookup & check/uncheck checkbox through Javascript

Jump to solution

Hi everybody,

I'm trying to enable/disable a lookup control through Javascript, this code works on text and choice controls:

//Option 1

NWF$("#"+controlID).attr('disabled','disabled');

NWF$("#"+controlID).removeAttr('disabled');

//Option 2

NWF$("#"+controlID).prop("disabled", true);

NWF$("#"+controlID).prop("disabled", false);

However, the code I posted above doesn't work on lookups.

Do you have any idea?

I'd also like to know how to check/uncheck a checkbox, I use the following code:

NWF$("#"+myCheckID]).prop('checked', true);

NWF$("#"+myCheckID]).prop('checked', false);

The checkbox is checked/unchecked, but the value doesn't change.

I connect the checbox to a calculated control, and the value is always the same (true/false), no matter if the checkbox is checked/unchecked.

I work with Nintex Forms 2013 2.9.3.1.

Thanks in advance.

Labels: (1)
0 Kudos
Reply
5 Replies
emha
Nintex Newbie

Re: Enable/Disable Lookup & check/uncheck checkbox through Javascript

Jump to solution

for lookup control try

NWF$("#"+controlID).closest('.nf-filler-control-border').prop("disabled", true);

reg. checkbox, is it yes/no checkbox or choice control with multiselect checkboxes?

Reply
apalazon
Nintex Newbie

Re: Enable/Disable Lookup & check/uncheck checkbox through Javascript

Jump to solution

Hi Marian,

I tried the code you suggested,it didn't work.

Regarding the checkbox question, yes, it is a reg. checkbox.

Thanks a lot.

0 Kudos
Reply
emha
Nintex Newbie

Re: Enable/Disable Lookup & check/uncheck checkbox through Javascript

Jump to solution

I've tested it on my own before I posted it here and it worked for me.

how does evaluate following for you

NWF$('#'+controlID).closest('.nf-filler-control-border').length;
NWF$('#'+controlID).length‍‍;

for check box try

NWF$('#'+myCheckID).click();
Reply
apalazon
Nintex Newbie

Re: Enable/Disable Lookup & check/uncheck checkbox through Javascript

Jump to solution

Hi Marian,

I' ve tried again, and both solutions worked perfectly. Thanks for your help.

I have to redo all the code I use to handle lookups, do you know how to select a lookup option?

This code worked in the older Nintex Forms versions:

NWF$("#"+lookupID).val("myvalue");

I was also able to append and remove options:

NWF$("#"+lookupID).append("<option value='" +ID+ "'>" + Value+ "</option>");

NWF$("#" +lookupID + " > option[value='" + ID + "']").remove();

None of this code is working now. Do you have any documentacion or code example you could share?

Thanks in advance.

0 Kudos
Reply
emha
Nintex Newbie

Re: Enable/Disable Lookup & check/uncheck checkbox through Javascript

Jump to solution

glad you get it working.

with the lookups there were significant changed in recent releases.

unfortunately, I'm not on the most recent forms version yet, so I do not know what exactly changed and how make it working again.

0 Kudos
Reply