function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VT878VT878 

Set value in controller from javascript

Hi, I want set value in controller from JavaScript and I have some problem.

I have find that the solutions are two: use <apex:param> or <apex:inputHidden> but the problem is always present.

On the Visualforce Page, I have a JavaScript variable, test, and I want set its value to variable myString in Apex Controller.
 
Apex Controller:
public class myController
{
   public String myString{get; set;}
   }

Visualforce Page:
<script>
   
    var test = 'testVariable';
    //Some code

</script>

<body>

   //Some markup

</body>

Thanks a lot.