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
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
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?
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 S0] position?
I think the second part of the question was a syntax error and that has been fixed.
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.
Thank you. Nintex Forms Version: 2.10.2.0. It's not multi-select, just a drop down lookup.
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
Amazing!! Thank you - again.
Is this thing: siblings('select.nf-client-control') documented somewhere? Like Nintex or JQuery?
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.
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.
Thank you, that is very helpful!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.