Guest User

Untitled

a guest
Jan 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <form onsubmit="serverconnect('Div1', 'query.php'); return
  2. false;"
  3. Minimum Discount: <br />
  4. <input type="radio" value="20%" name="discount" /> 20% <br />
  5. <input type="radio" value="15%" name="discount" /> 15% <br />
  6. <input type="radio" value="10%" name="discount" /> 10% <br />
  7. <input type="radio" value="5%" name="discount" /> 5% <br />
  8. <input type="submit" value="Refine Search" />
  9. </form>
  10.  
  11. <script language="javascript" type="text/javascript">
  12.  
  13.  
  14. var xmlhttp = false;
  15.  
  16.  
  17. if (window.XMLHttpRequest)
  18. {
  19. xmlhttp = new XMLHttpRequest();
  20. }
  21. else if (window.ActiveXObject)
  22. {
  23. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  24. }
  25.  
  26.  
  27. function serverconnect(divID, datalocation)
  28. {
  29. var1=$clickvalue;
  30. if(xmlhttp)
  31. {
  32. var obj = document.getElementById(divID);
  33. xmlhttp.open("GET", datalocation);
  34.  
  35. xmlhttp.onreadystatechange = function()
  36. {
  37. if (xmlhttp.readyState == 4 &&
  38. xmlhttp.status == 200)
  39. {
  40. obj.innerHTML = xmlhttp.responseText;
  41. }
  42. }
  43. xmlhttp.send(null);
  44. }
  45.  
  46. }
  47. </script>
  48.  
  49. <input type="radio" value="20%" name="discount" id="discount" /> 20% <br />
  50.  
  51.  
  52. var obj = document.getElementById(divID);
  53. var disc = document.getElementById("discount");
  54. xmlhttp.open("GET", datalocation + "?disc="+disc);
Add Comment
Please, Sign In to add comment