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

How to set a multi line text box based on drop down (when in use)

Jump to solution

All,

On my form (Nintex 2013)

I have a list lookup control connected to a separate list within my site.

This list has 2 columns: title and description. The list lookup shows the title values.

I have a multi line text box.

If a value is selected from the list lookup control how can the multi line text box be populated with the description field data and still be editable?

If list lookup control value is not selected the multi line text box will still be used, just not prepopulated.

I'm wanting to do this without a workflow as the end users will select a value from the lookup list and then want to start writing in the multi line text box.


Thanks

Andrew

Labels: (1)
0 Kudos
Reply
4 Replies
Highlighted
Automation Master
Automation Master

Re: How to set a multi line text box based on drop down (when in use)

Jump to solution

eg. following easy way

it will append description related to selected lookup entry to textbox content

NWF.FormFiller.Events.RegisterAfterReady(function() {   
  NWF$('#'+varLkp).change(function(){
     var lkpSelection =  NWF$(this).val();
     var lkpID = lkpSelection.match(new RegExp(SPClientTemplates.Utility.UserLookupDelimitString)) ? NWF.RuntimeFunctions.parseLookup(lkpSelection,false) : lkpSelection;
     NWF.RuntimeFunctions.SPLookup('testlist','ID',lkpID,'description').done(function(data){
        var currContent = NWF$('#'+varMLTB).val();
        if (data.length){
           NWF$('#'+varMLTB).val(currContent + (currContent.length ? '\r\n' : '') + data);             
        }
     })
  })
})
‍‍‍‍‍‍‍‍‍‍‍‍
Reply
Highlighted
Nintex Newbie

Re: How to set a multi line text box based on drop down (when in use)

Jump to solution

Thanks, but I have no idea what this is or where it goes. V. new to Nintex Forms.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: How to set a multi line text box based on drop down (when in use)

Jump to solution

so you probably might want to start with something what is provided OOTB without scripting...

anyway, so that you could learn anything new today (), proceed with the following

- copy the script provided and paste it into forms settings/Custom Javascript

- configure javascript variable of your lookup control to varLkp (you will find the settings in Advanced section at about very end of control's setting dialog)

- configure javascript variable of your text box control to varMLTB

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: How to set a multi line text box based on drop down (when in use)

Jump to solution

Marian,

Brilliant, thanks, attempting to do OOTB. Yet, will play with the JavaScript as well.


Love the learning.

Thanks

A

Reply