Set value of Single Line Text field based on Choice List

  • 26 February 2020
  • 6 replies
  • 385 views

Badge +4

I have a choice list field called "ExpenseType" with options Meals and Parking.

I have a single line text field called "ExpenseCost".  I want this field to be editable (cannot be a calculated field).

 

When I select "Meals" from the choice list, I want the "ExpenseCost" field to be automatically populated with "$20".  When "Parking" is selected, I want the field to be populated with "$10".

 

Do I need to use Javascript to do this?  Can someone point me in the right direction?


6 replies

Userlevel 6
Badge +22

Hi,


 


Only a responsive form will allow you to set the valuer on a Single lines of text control.


Set a rule like:



I have attached my form that demonstrates this concept.


 

Badge +4

Thanks Simon, but is there anyway of doing this using the Classic Forms?

Userlevel 6
Badge +22
Unfortunately classic forms does not have the set value feature.
This will need to be done with Javascript.
Badge +4

Can anyone help with the Javascript to accomplish this in Classic mode?

Userlevel 6
Badge +22
There are a lot of threads on this forum for this.

e.g https://community.nintex.com/t5/Nintex-for-SharePoint/Setting-a-form-field-value-based-on-choice-value-with-Javascript/m-p/57772
Badge +1
Thanks so much for this! 🙂

Reply