Not applicable

Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Hi,

Is there any way to change the text of the textbox based on the selection of the dropdown?

thanks

Tags (1)
Reply
6 Replies
christopheraucq
Automation Master
Automation Master

Re: Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Hi Divya,

I am O365 but it should be the same on Premises.

In my sample, I put in my text box the text value of my dropdown box.

In the setting of your dropdown box, give a name to Client ID JavaScript variable name: ddlContentType

In the setting of your text box, give a name to Client ID JavaScript variable name: txtAppendix

If you want that your text box is disabled, add this line NWF$('#' + txtAppendix).prop("readonly", true);

In Form Settings, under Custom Javascript,

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

NWF$('#' + txtAppendix).prop("readonly", true);

NWF$("#"+ddlContentType).change(function()

{

  var selectedValue = NWF$('#' + ddlContentType + ' option:selected');

  NWF$("#"+txtAppendix).val(selectedValue.text());

});

});

View solution in original post

Reply
kelliganp
Nintex Newbie

Re: Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Hi  Christophe,

I am looking at your solution and incorporating it for myself. In the line below, is the line added to the text box configuration or in Form Settings, under Custom JavaScript?

If you want that your text box is disabled, add this line NWF$('#' + txtAppendix).prop("readonly", true);

Thanks Christophe!

0 Kudos
Reply
christopheraucq
Automation Master
Automation Master

Re: Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Hi

In the Form Settings

Regards,

Christophe

0 Kudos
Reply
Chris_Ben
Automation Master
Automation Master

Re: Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Divya,

Do you want that text box to still be editable after you have made the selection?  If so, use Christophe's suggestion.  If not, you can use a calculated value and bind that to your list column.

Cheers,

Chris

Reply
Not applicable

Re: Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Hi,

Just want to say that these two options above are best options to use.

Reply
Not applicable

Re: Is there a way to change the value of the textbox based on the dropdown selection?

Jump to solution

Hi, Divya Nair​, Let us know if either of those options proved helpful. Thanks!

0 Kudos
Reply