sspence65

show text box on button check

Apr 25th, 2017
177
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.97 KB | None
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function hide()
  5. {
  6.     document.getElementById('mytext1Desc').style.display='none';
  7.     document.getElementById('mytext1URL').style.display='none';
  8.     document.getElementById('mytext2Desc').style.display='none';
  9.     document.getElementById('mytext2URL').style.display='none';
  10.     document.getElementById('mytext3Desc').style.display='none';
  11.     document.getElementById('mytext3URL').style.display='none';
  12.     document.getElementById('mytext4Desc').style.display='none';
  13.     document.getElementById('mytext4URL').style.display='none';
  14.     return;
  15. }
  16.  
  17.  
  18.  
  19. function showText1(obj)
  20. {
  21. if(obj.id=='Show')
  22. {
  23. document.getElementById('mytext1Desc').style.display='block';
  24. document.getElementById('mytext1URL').style.display='block';
  25.  
  26. }
  27. else
  28. {
  29. document.getElementById('mytext1Desc').style.display='none';
  30. document.getElementById('mytext1URL').style.display='none';
  31.  
  32. }
  33. return;
  34. }
  35. function showText2(obj)
  36. {
  37. if(obj.id=='Show')
  38. {
  39. document.getElementById('mytext2Desc').style.display='block';
  40. document.getElementById('mytext2URL').style.display='block';
  41.  
  42. }
  43. else
  44. {
  45. document.getElementById('mytext2Desc').style.display='none';
  46. document.getElementById('mytext2URL').style.display='none';
  47.  
  48. }
  49. return;
  50. }
  51. function showText3(obj)
  52. {
  53. if(obj.id=='Show')
  54. {
  55. document.getElementById('mytext3Desc').style.display='block';
  56. document.getElementById('mytext3URL').style.display='block';
  57.  
  58. }
  59. else
  60. {
  61. document.getElementById('mytext3Desc').style.display='none';
  62. document.getElementById('mytext3URL').style.display='none';
  63.  
  64. }
  65. return;
  66. }
  67. function showText4(obj)
  68. {
  69. if(obj.id=='Show')
  70. {
  71. document.getElementById('mytext4Desc').style.display='block';
  72. document.getElementById('mytext4URL').style.display='block';
  73.  
  74. }
  75. else
  76. {
  77. document.getElementById('mytext4Desc').style.display='none';
  78. document.getElementById('mytext4URL').style.display='none';
  79.  
  80. }
  81. return;
  82. }
  83. </script>
  84. </head>
  85. <body onload="hide()">
  86.  
  87.  
  88. Task 1:
  89. <br>
  90. <input type="radio" name="task1" onClick="showText1(this)" id="Hide" value="1"> Print box Label (with instructions)<br>
  91. <input type="radio" name="task1" onClick="showText1(this)" id="Hide" value="2"> Print Unit Label (without instructions)<br>
  92. <input type="radio" name="task1" onClick="showText1(this)" id="Show" value="3"> Other
  93. <input type="text" name="Task1OtherDesc" placeholder="Description" id="mytext1Desc"><br>
  94. <input type="text" name="Task1OtherFile" placeholder="File" id="mytext1URL">
  95. <p>
  96.  
  97. Task 2:
  98. <br>
  99. <input type="radio" name="task2" onClick="showText2(this)" id="Hide" value="1"> Print box Label (with instructions)<br>
  100. <input type="radio" name="task2" onClick="showText2(this)" id="Hide" value="2"> Print Unit Label (without instructions)<br>
  101. <input type="radio" name="task2" onClick="showText2(this)" id="Show" value="3"> Other
  102. <input type="text" name="Task2OtherDesc" placeholder="Description" id="mytext2Desc"><br>
  103. <input type="text" name="Task2OtherFile" placeholder="File" id="mytext2URL">
  104. <p>
  105.  
  106. Task 3:
  107. <br>
  108. <input type="radio" name="task3" onClick="showText3(this)" id="Hide" value="1"> Print box Label (with instructions)<br>
  109. <input type="radio" name="task3" onClick="showText3(this)" id="Hide" value="2"> Print Unit Label (without instructions)<br>
  110. <input type="radio" name="task3" onClick="showText3(this)" id="Show" value="3"> Other
  111. <input type="text" name="Task3OtherDesc" placeholder="Description" id="mytext3Desc"><br>
  112. <input type="text" name="Task3OtherFile" placeholder="File" id="mytext3URL">
  113. <p>
  114.  
  115. Task 4:
  116. <br>
  117. <input type="radio" name="task4" onClick="showText4(this)" id="Hide" value="1"> Print box Label (with instructions)<br>
  118. <input type="radio" name="task4" onClick="showText4(this)" id="Hide" value="2"> Print Unit Label (without instructions)<br>
  119. <input type="radio" name="task4" onClick="showText4(this)" id="Show" value="3"> Other
  120. <input type="text" name="Task4OtherDesc" placeholder="Description" id="mytext4Desc"><br>
  121. <input type="text" name="Task4OtherFile" placeholder="File" id="mytext4URL">
  122. <p>
  123.  
  124. </body>
  125. </html>
RAW Paste Data Copied