dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: onClick radio button

  1. #1
    Join Date
    May 2003
    Posts
    65

    onClick radio button

    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

  2. #2
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Use innerHTML of a DIV element. An example would be online here: http://jona.t35.com/experiments/nn4_layer.html

    Jona

  3. #3
    Join Date
    May 2003
    Posts
    65
    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?

  4. #4
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    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+"'>"

  5. #5
    Join Date
    May 2003
    Posts
    65
    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

  6. #6
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles