Nintex for SharePoint Forum
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Hi
I want to auto-select field values based on values elsewhere in the form.
============================
Example:
Drop-down menu A: Creature
Choices: Man, Dog, Spider
Drop-down menu B: Species
Choices: Human, Canine, Arachnid
When a user selects Man in menu A, menu B auto-populates as Human.
When a user selects Dog in menu A, menu B auto-populates as Canine.
When a user selects Spider in menu A, menu B auto-populates as Arachnid.
=============================
These menu choices are not based on lookups of other lists. Using lookup lists is not practical for us. We need our forms in one list without the requirement of maintaining supporting lists.
I understand that InfoPath allows this functionality quite easily, but can't seem to find something similar in Nintex Forms.
I don't mind using JavaScript, just not sure if this can be done without in the latest version or how I would go about doing it.
Appreciate any help that can be offered.
Platform: Nintex Forms 2013 2.10.1.0
Environment SharePoint 2013 Enterprise
Solved! Go to Solution.
Do these two threads give you a good starting point?
How to set default value some option in drop down list look up using JQuery or Javascript
Thanks for the links but they don't really answer my question. I don't want to auto populate fields when the form is opened. I want to create a link between values in two drop-down menus. Selecting one value in menu A changes the value in menu B, dynamically, while the form is open.
Hi Harry,
Marian's link goes specifically into how to modify the value of one field with the event being the change of another. The two links I provided give more details on how to set a dropdown field using Javascript. You can use both of these to create the solution you're looking for.
You can also check out this resource: How to Create Cascading Choice Controls – Nintex Forms from
here is the script which (re)sets value of dropdown control (choice) based on value of other dropdown control (choice as well).
second control follows each change of the first one. if first control is set to a value out of defined list, second control is cleared.
jsDDA_Creature and jsDDB_Species are javascript variables configured for respective controls.
the script should be placed into form settings >> Custom JavaSript
NWF.FormFiller.Events.RegisterAfterReady(function () {
NWF$('#'+jsDDA_Creature).change(function(evt){
switch(evt.target.value){
case 'Man' :
NWF$('#'+jsDDB_Species).val('Human');
break;
case 'Dog':
NWF$('#'+jsDDB_Species).val('Canine');
break;
case 'Spider':
NWF$('#'+jsDDB_Species).val('Arachnid');
break;
default:
//no creature
NWF$('#'+jsDDB_Species).val('');
break;
}
})
})
choice dropdown choice dropdown dropdown choice set dropdown value by other dropdown set choice value by other choice populate dropdown populate choice
Thank you very much for your effort Marian but I can't get that to work. The values are not changing.
I put the script in the form settings custom Javascript section and gave the drop-down menus variable names in their respective settings (store client id in javascript variable).
Am I missing something else?
can you check developer console for any errors?
press F12 in browser, in window that opens switch to 'Console' tab, return to browser and run the form. watch dev console whether there are not any errors reported.
I checked it yes and it said jsDDA_Creature is undefined.
I can't tell what's nintex wrap code and what's not. Is the jsDDA and jsDDB some type of Nintex code or wrapper or just an example variable name that I can change?
OK it's working after I added the jsDDA and jsDDB to the respective control names.
Many thanks for your help on this. Apologies I 'm such an amateur at JS. Hopefully I can improve soon but getting to the level above may take some time