cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Store Client ID in JavaScript variable

Jump to solution

Hi!

I would like to know how to use the “Store Client ID in JavaScript variable” at Choice control for put the ID of the user that selects de option into a label control.

Labels: (1)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

Hi Merildo,

 

So If you have configured Store Client ID in JavaScript variable” to "Yes", you can define one variable name and you can access that variable into your custom javascript. It will help you to access choice control into your javascript by using - document.getElementById(variablename). So When you write javascript, you can access the value from choicecontrol.

 

Now in order to show selected value from choice control, you have 2  options.

1. You can use Calculated control and set it's formula to choice control name

2. Use custom javascript and access choice control and label control by using  Store Client ID in JavaScript variable”  and set the value.

 

Let me know if any questions.

 

Regards,

Shirin

0 Kudos
Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

Hi, Shirin

I used the first one option

Thank you

0 Kudos
Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

Hi,

How I can show the value of this Client ID in JavaScript variable in (((lable)))???

0 Kudos
Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

Hi,

You can do following ways.

  1. Set one empty css class. e.g. - test-class.
  2. Add label and open settings. Set Formatting >> CSS class - test-class.
  3. Open Form Settings >> Custom Javascript and add following script.

NWF.FormFiller.Events.RegisterAfterReady(function ()
{

NWF$('#' + userChoiceCtrl).change(function(){
var selectedText = NWF$('#' + userChoiceCtrl + ' option:selected').text();
NWF$('.test-class').find('span').text(selectedText);
});
});

I have attached exported form. You can import and run it.

Let me know if any issues.

Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

hi ,

 

thanks a lot your page help me a lot to showing calculated value in textbox box by using Client ID in JavaScript variable . its working fine . but I noticed something when I use (IF condition ) for this textbox , IF condition not working correctly with this textbox . do u know why ???

0 Kudos
Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

Hi,

Can you please send me your form or code so I can look at that? 

0 Kudos
Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

Sure but how I can upload form here ??

0 Kudos
Reply
Workflow Hero

Re: Store Client ID in JavaScript variable

Jump to solution

When you replying in editor, go to advanced editor mode and there should be attachment option at the bottom left side. 

0 Kudos
Reply