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

Is it possible to clear value of lookup column?

Jump to solution

I would like to reset or clear a lookup column that could have one or more values selected with causing a form save.

thank you

Reply
9 Replies
emha
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

lookup column that could have one or more values selected

can you clarify that a bit more?

is it 'checkbox multi selection', 'list multi selection' or 'multi select'?

with causing a form save

as well for this - do you mean you hit a button, it clears lookup control and save form?

0 Kudos
Reply
nps9
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

Thank you Marian!

So I have a site lookup column that I want to have cleared or set back to "Please select a value..." if a checkbox is checked on (or a button clicked). This is the code I am using:

NWF$(document).ready(function(){

   NWF$('#'+cidContractor).change(function() {

      if(NWF$('#'+ cidContractor).prop("checked")) {
         NWF$('#'+ cidTraining).val("");
      }
   })
});

cidContractor is the checkbox and cidTraining is the lookup. It looks like the lookup value is just a string but it doesn't remove the value if I set the value to an empty string or "Please select a value...". So maybe it should be [0] position?

I think the second part of the question was a syntax error and that has been fixed.

0 Kudos
Reply
emha
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

what form version are you on? solution is different for different versions.

as well, above you mentioned you have lookup multiselect capable. but from the screenshot it doesn't seem to be so.

can you for sure post its configuration.

0 Kudos
Reply
nps9
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

Thank you. Nintex Forms Version: 2.10.2.0. It's not multi-select, just a drop down lookup.

0 Kudos
Reply
emha
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

ok, then following should reset lookup value

NWF$('#'+cidTraining).val("");
NWF$('#'+cidTraining).siblings('select.nf-client-control').val('**SelectValue**');
‍‍

‌ clear value‌ forms 2.9 and newer‌

Reply
nps9
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

Amazing!! Thank you - again.

Is this thing: siblings('select.nf-client-control') documented somewhere? Like Nintex or JQuery?

0 Kudos
Reply
emha
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

no it isn't.

and note it's valid just for current forms version(s). prior v2.9 the same was being achieved completely different way (that's why I asked for your forms version). and no one knows when nintex decides to change it again.

Reply
akrasheninnikov
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

The jQuery.siblings() method is documented under docs.jquery.com Traversing section, I suppose. The DOM object(s) selector 'select.nf-client-control' (any element of node name 'select' that has 'nf-client-control' among its CSS classes) is based on the HTML markup generated by Nintex Forms and something that Nintex should document and keep consistent as much as possible.

Reply
nps9
Nintex Newbie

Re: Is it possible to clear value of lookup column?

Jump to solution

Thank you, that is very helpful!

Reply