Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public String variable1 {get; set;}
- public String variable2 {get; set;}
- public void mTest(){
- System.debug(variable1 + ' ' + variable2);
- }
- }
- <apex:page controller="Test">
- <apex:form>
- <apex:actionFunction name="JS" action="{!mTest}">
- <apex:param assignTo="{!variable1}" name="var1" value=""/>
- <apex:param assignTo="{!variable2}" name="var2" value=""/>
- </apex:actionFunction>
- </apex:form>
- <form>
- <input type="text" id="input1"/><br/>
- <input type="text" id="input2"/><br/>
- <button type="button" onclick="doJS()">
- Click
- </button>
- </form>
- <script>
- function doJS(){
- let x = document.getElementById('input1').value;
- let y = document.getElementById('input2').value;
- JS(x, y);
- }
- </script>
Add Comment
Please, Sign In to add comment