How can I make single line of text controls show the same values?

  • 10 January 2019
  • 3 replies
  • 1 view

Badge +1

Is it possible in a Nintex classic form to create a single line of text field that can be used in multiple places but maintain the same values? Without using a calculated field. I want the users to be able to change it from two different tabbed views i created in my form.


3 replies

Badge +7

You're going to need to use JavaScript.

You could do something like this (I have not tested this):

NWF$('#' + FieldOne).change(function(){
     NWF$('#' + FieldTwo).val(NWF$('#' + FieldOne).val());
});

NWF$('#' + FieldTwo).change(function(){
     NWF$('#' + FieldOne).val(NWF$('#' + FieldTwo).val());
});

I'm not sure off the top of my head if this will trigger a loop.

You may want to add in an 'if FieldOne != FieldTwo' and vice versa.

Badge +1

Hi Chad - This example worked perfectly for what I need! Thanks so much for your help.

Would you happen to know how to do this for a radio button field as well?

-Chris

Badge +7

I did a little testing with this, but don't have more time to look into it right now. It worked for me a couple times and then stopped. I'm not sure exactly sure what the issue is, but this should get you started:

NWF$('#' + optOne + ' input').change(function(){
     if(NWF$(this).is(':checked')) {
          var id = NWF$(this).attr('id');
          id = id.substr(id.lastIndexOf("_"));
          NWF$('#' + optTwo + id).attr('checked','checked');
     }
});
NWF$('#' + optTwo + ' input').change(function(){
     if(NWF$(this).is(':checked')) {
          var id = NWF$(this).attr('id');
          id = id.substr(id.lastIndexOf("_"));
          NWF$('#' + optOne + id).attr('checked','checked');
     }
});

optOne is the Client ID JavaScript Variable of the first radio button field, and optTwo is for the second one.

Keep in mind this will only work if both choice fields have identical options in the same order.

Reply