265
Views
3
Comments
Solved
How to set a hidden variable      And set JavaScript value to hidden variable
Question

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


2020-01-08 12-23-57
Jitender Gaur
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';


 



2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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?

UserImage.jpg
Gonçalo Oliveira

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

2020-01-08 12-23-57
Jitender Gaur
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';


 



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.