Guest User

Untitled

a guest
Jun 18th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public class Test {
  2. public String variable1 {get; set;}
  3. public String variable2 {get; set;}
  4.  
  5. public void mTest(){
  6. System.debug(variable1 + ' ' + variable2);
  7. }
  8. }
  9.  
  10. <apex:page controller="Test">
  11. <apex:form>
  12. <apex:actionFunction name="JS" action="{!mTest}">
  13. <apex:param assignTo="{!variable1}" name="var1" value=""/>
  14. <apex:param assignTo="{!variable2}" name="var2" value=""/>
  15. </apex:actionFunction>
  16. </apex:form>
  17.  
  18. <form>
  19. <input type="text" id="input1"/><br/>
  20. <input type="text" id="input2"/><br/>
  21. <button type="button" onclick="doJS()">
  22. Click
  23. </button>
  24. </form>
  25.  
  26. <script>
  27. function doJS(){
  28. let x = document.getElementById('input1').value;
  29. let y = document.getElementById('input2').value;
  30.  
  31. JS(x, y);
  32. }
  33. </script>
Add Comment
Please, Sign In to add comment