Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title> Submit a Contract </title>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <script type="text/javascript">
  7. function toggleExternal() {
  8. document.getElementById("extText").disabled = false;
  9.  
  10. var divis_el = document.getElementById("division");
  11. for (var i = 0; i < divis_el.children.length; i++) {
  12. divis_el.children[i].disabled = true;
  13. }
  14. }
  15. function toggleDivision() {
  16. document.getElementById("extText").disabled = true;z
  17. var divis_el = document.getElementById("division");
  18. for (var i = 0; i < divis_el.children.length; i++) {
  19. divis_el.children[i].disabled = false;
  20. }
  21. }
  22.  
  23. function enableTextbox() {
  24. var val = document.getElementById("mySelect").selectedIndex;
  25. if (val == 0 || val == 1 ||val == 2 ||val == 3 ||val == 4 ||) { document.getElementById("otherTxt").disabled = true}
  26. if (val == 5) { document.getElementById("otherTxt").disabled = true; }
  27. }
  28. </script>
  29. </head>
  30. <body>
  31. <form method="post" action="" enctype="multipart/form-data">
  32. ID:<br>
  33. <input type="hidden" name="id" value="50" />
  34.  
  35. <label for = "client1">
  36. <input type="radio" name="client_type" id = "client1" value="Division" checked onclick="toggleDivision()"/> Division
  37. </label>
  38. &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
  39. <label for ="client2">
  40. <input type="radio" name="client_type" id = "client2" value="External" onclick="toggleExternal()"/> External
  41. </label>
  42. &nbsp
  43. <input disabled type="text" id="extText" name="client_details2" value=""/>
  44. <br><br>
  45.  
  46. <div id="division">
  47. Division:
  48. <select id="mySelect" name="client_details" onchange="enableTextbox()">
  49. <option value="Choose">Choose Division...</option>
  50. <option value="Distribution">Distribution</option>
  51. <option value="Transmission">Transmission</option>
  52. <option value="Generation">Generation</option>
  53. <option value="Procument">Procument</option>
  54. <option value="Other">Others</option>
  55. </select>
  56. <br><br>
  57. Others:<input type="text" id="otherTxt" name="client_details1" value="" disabled/>
  58. <br>
  59. </div>
  60. <br>
  61. <input type="submit" name="submit" value="Submit"/>
  62. </form>
  63. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement