Thread: Dynamically Generating
Results 1 to 4 of 4
PHP for automatically generating file/link list with file titles Forum: PHP ForumReplies: 1
dynamically changing height of a div Forum: CSS ForumReplies: 3
Generating reports from databases Forum: CGI Perl ForumReplies: 2
Dynamically Generating Forum: HTML ForumReplies: 0
generating Html pages and HREF Forum: CGI Perl ForumReplies: 8
05-16-2006, 09:40 PM #1
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..
05-17-2006, 11:08 AM #2
Re: Dynamically GeneratingOriginally Posted by drhone51
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.
05-17-2006, 11:53 AM #3
05-17-2006, 12:07 PM #4
Re: Dynamically Generating
Still having issues with this even though advice got me a little closer.