Author |
Topic  |
|
kolucoms6
Average Member
  
845 Posts |
Posted - 21 June 2007 : 00:23:56
|
I am looking forward to :(I know it must be a simple javascript)
I will have Two Radio Buttons
Now, when use select radio1, it will display a,b,c,d field as input box.
When use select radio2, it will display e,f,g,h,i field as input box. |
|
kolucoms6
Average Member
  
845 Posts |
Posted - 21 June 2007 : 07:30:46
|
Basically...
Two RADIO BUTTONS :
Radio1 Radio2
When I select Radio1, it will display or may be make enable a,b,c,d .. four Input boxes.
When I select Radio2, it will display or may be make enable e,f,g,h .. four Input boxes.
Note : a,b,c,d,e,f,g,h,: Name of input Boxes. |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 21 June 2007 : 07:45:35
|
There are numerous scripts out there that do this (or something like it), and even more numerous articles on how to build said scripts. Have you spent a little time with your search engine of choice? |
 |
|
kolucoms6
Average Member
  
845 Posts |
Posted - 21 June 2007 : 12:44:24
|
I got below code:
<script type="text/javascript"> var _lastVisibleDiv = 0; function ToggleView(objButton) { var strDivId = "div_" + objButton.value; var objDiv = document.getElementById(strDivId); if (!objDiv) { alert("debug warning: no such div " & strDivId); return false; } if (_lastVisibleDiv) _lastVisibleDiv.style.display = "none"; objDiv.style.display = ""; _lastVisibleDiv = objDiv; } </script> <div id="div_radio1" style="display: none;"> First: <input type="text" name="text1" /><input type="text" name="text2" /><input type="text" name="text3" /> </div> <div id="div_radio2" style="display: none;"> Second: <input type="text" name="text5" /><input type="text" name="text6" /><input type="text" name="text7" /> </div> first<input type="radio" name="myradio" value="radio1" onclick="ToggleView(this);" /> second<input type="radio" name="myradio" value="radio2" onclick="ToggleView(this);" />
But it doesnt work when i place these inside a table. |
 |
|
|
Topic  |
|
|
|