wilkies0106aw
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

0 Kudos
Reply
5 Replies
emha
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
wilkies0106aw
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
emha
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
wilkies0106aw
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
Stonehage
Nintex Newbie

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

Jump to solution

Not having any luck with this. I'm on 2013 On Prem.

 

Wonder if you can help?

 

This is my your code adjusted for my List...

 

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('Appraisals - Lookups','ID',lkpID,'description').done(function(data){var currContent = NWF$('#'+varMLTB).val(); if (data.length){NWF$('#'+varMLTB).val(currContent + (currContent.length ? '\r\n' : '') + data);}})})})

 

Nothing happens once I select from my drop down.

0 Kudos
Reply