Click to See Complete Forum and Search --> : onClick radio button


tiger66
05-27-2003, 02:09 PM
I am trying to use radio buttons to extend my form
I tried check the value of radio button then display the addition fields to the form using document.write("..."). However, when I click on the radio button, it shows the extended part but all the other fields disappear(the fields that display on the screen at beginning)

Where did I do wrong?

Any example will be appreciated

Thanks in advance

Jona
05-27-2003, 02:28 PM
Use innerHTML of a DIV element. An example would be online here: http://jona.t35.com/experiments/nn4_layer.html

Jona

tiger66
05-27-2003, 03:30 PM
Hi Jona
This is more complicated than I thought

I have a questions regarding the use of innerHTML
you used myL.innerHTML=document.forms[0].elements[1].value; to display the value

I tried to display that value in a text field eg
myL.innerHTML = "<input type ='text' value = 'document.forms[0].elements[1].value'>". However, it displays 'document.forms[0].elements[1].value'.
How could I resolve this problem?

khalidali63
05-27-2003, 03:37 PM
you are missing ++( string concatenation operators here

this line
myL.innerHTML = "<input type ='text' value = 'document.forms[0].elements[1].value'>"

should be

myL.innerHTML = "<input type ='text' value = '"+document.forms[0].elements[1].value+"'>"

tiger66
05-27-2003, 03:49 PM
Thanks khalidali63

In the example Jona gave me, the name of layer and div are the same

<layer name="myL"><div id="myL">This is a layer in NN4.</div></layer>

So, when I use myL.innerHTML, which one am I refering to?
Do I need both? Is innerHTML a new property, I can't find it in my javascript Bible book?

Does anyone know any easier way to implement my radio button functionality? Any input will be appreciated


Thanks in advance

Jona
05-27-2003, 10:32 PM
If you look at my source code, you'll see I refer to the layer for Netscape, and the DIV for IE and NS6+

Jona