How to set a hidden variable And set JavaScript value to hidden variable

How to set a hidden variable   And set JavaScript value to hidden variable,Thank you!


Hi le le,

I'm sorry, but I don't understand your question. What is a "hidden variable"? And what do you want to do with JavaScript? What kind of app are you creating, Mobile or Reactive or Web?

Hello Le Le,


Did you meant to say, hidden input and change is value using javascript?

If so select the input, in the 'Visible' put false, and create a JS that does something like this "$('#id').val('xxx');" to change the value.


With the best regards,

Gonçalo

Solution

Hi le le,


If you want to use value in your action and don't want to show to user then you can set that value in any local variable and after then you can use that variable in any server action. 


If you want to change that value in java script code then you can create a hidden input bound to that local variable. Then manipulate it using javascript

like : 

 document.getElementById('"+HiddenInput.Id+"').value = 'xxx';


 



Solution