kgiles
Scholar

Field equals other field

Jump to solution

In my form when one drop down field changes "EpisodeID", I would like Title to mirror the change with the exact same info selected. Thanks

0 Kudos
Reply
5 Replies
Garrett
Communicator

Re: Field equals other field

Jump to solution

Hi @kgiles 

Which type of Form are you using Responsive or Classic?

 

Using Responsive Form - Add a choice dropdown control

Garrett_0-1655335200349.png

Add a Rule for the Title control. Set the Title value to the value of of the dropdown

Garrett_1-1655335313567.png

The result

Garrett_3-1655335490514.pngGarrett_2-1655335466670.png

 

 

 

 

Reply
kgiles
Scholar

Re: Field equals other field

Jump to solution
I am using Classic. Thank you for this though.
0 Kudos
Reply
Garrett
Communicator

Re: Field equals other field

Jump to solution

Hi @kgiles 

 

Using Classic Form

Using Choice control named ChoiceType

Set the values in Choices field

Set the JavaScript variable name of 'txtChoice' for the control

Garrett_0-1655388459139.png

For the Title - Text control - Set the JavaScript variable "txtTitle"

 

Next, we need to add some interactivity using JavaScript.

Add custom JavaScript to: Form Settings > Custom JavaScript

 

NWF$(document).ready(function () {
    NWF$("#" + txtChoice).change(function () {
        var x = NWF$("#" + txtChoice + " option:selected").val();
        var y = NWF$("#" + txtTitle);
        y.val(x);
    });
});

 

When the Choice changes, this function is run.

It set the value of Title (var Y) to the value of Choice (var X) 

txtChoice and txtTitle is defined in the Control settings.

 

The result

Garrett_3-1655389417042.png

Garrett_1-1655389344457.png

Garrett_2-1655389378974.png

 

Hope this helps

Reply
Garrett
Communicator

Re: Field equals other field

Jump to solution

Hi @kgiles 

 

Was my suggestion of any help? Please let me know, so I can see if I'm able to assist further

Reply
kgiles
Scholar

Re: Field equals other field

Jump to solution
This is great! Thank you for your help!
0 Kudos
Reply