69 users online (0 members and 69 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 1
  2. dynamically changing height of a div    Forum: CSS Forum
    Replies: 3
  3. Generating reports from databases    Forum: CGI Perl Forum
    Replies: 2
  4. Dynamically Generating    Forum: HTML Forum
    Replies: 0
  5. generating Html pages and HREF    Forum: CGI Perl Forum
    Replies: 8
  1. #1
    drhone51's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    3

    Dynamically Generating

    I have a project in school and I would appreciate it if anybody can help me out with this. I don't have much experiencing in DHTML just trying to figure this one out.

    My issue is I am trying to use a radio button to dynamically generate text in a text box below. Then by adding more questions to the questionnaire i can create more text in text box. So by the end of the questionnaire i will have a summary in the text box. If anybody can help me out with this it will be greatly appreciated..

    Thanks

  2. #2
    Captain Logical's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    3

    Re: Dynamically Generating

    Quote Originally Posted by drhone51
    I have a project in school and I would appreciate it if anybody can help me out with this. I don't have much experiencing in DHTML just trying to figure this one out.

    My issue is I am trying to use a radio button to dynamically generate text in a text box below. Then by adding more questions to the questionnaire i can create more text in text box. So by the end of the questionnaire i will have a summary in the text box. If anybody can help me out with this it will be greatly appreciated..

    Thanks
    You need to associate the relevant text with each radio button, the simplest way being to assign it to the button's value attribute.
    You need a function we'll call 'bScan', that initially clears the textarea then scans all the radio buttons in the form. Whenever it detects a checked button, it appends that button's text to the textarea.
    bScan must be called by the onclick handler of all the involved radio buttons, and this assignment would look much better done using a loop, rather than hard-coding it into the tag of each button.

    This exercise is about addressing and reading form elements, which is safer and more efficient when done via the document.forms collection, rather than document.getElementById.

    You need to know the proper way to read a set of radio buttons.

    To append text to a textarea use: form.element.valu+=newText.

    HTH

  3. #3
    drhone51's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    3

    Re: Dynamically Generating

    Thanks for the info.

  4. #4
    drhone51's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    3

    Re: Dynamically Generating

    Still having issues with this even though advice got me a little closer.



Tags for this Thread