Click to See Complete Forum and Search --> : form javascript hide/show


esthera
12-02-2003, 10:22 AM
I have a form.

Their are 2 radio butons button 1 button2 and button3

Based on which radio button is selected I want different text to show

for example

if button 1 is selected then this will show:



<tr><td class=formtext>Price:</td>
<Td class=formtext><input name=button1 type=text></Td>
</tr>

if button2 then

<tr><td class=formtext>Price:</td>
<Td class=formtext><input name=button2 type=text></Td>
</tr>

and if button3 is chosen then both will show.


Can anyone help me with how to do this?

TheBearMay
12-03-2003, 08:30 AM
You could try something like:

<input type='radio' onclick="this.checked='true';cell1.style.visibility='visible';cell2.style.visibility='visible'")>
<table>
<tr><td class=formtext id='cell1' style='visibility:hidden'>Price:</td>
<Td class=formtext id='cell2' style='visibility:hidden'><input name=button1 type=text></Td>
</tr>
</table>