View Full Version : Radio buttons to populate in a textarea

11-09-2011, 01:54 PM
Hello all!

I have a simple HTML code, with radio buttons. What I need to do is make the value of the radio buttons to populate in a textarea instead of another link or CGI

i.e I want the text area in the same page to be the 'output' of the Radio buttons

I found the below template and added to it the text area.

I think what I need to change is the html_form_handler.cfm (in red), and replace it with an action to throw the outcome to the below textarea

For example the textarea field in the end should have the value of the radio button chosen in 'preferred color' in a line, and the value of the radio button chosen in 'preferred item' in a second line

<form action="/html/codes/html_form_handler.cfm" method="get">
<p><b>Preferred Color:</b></p>
<input type="radio" name="preferred_color" value="Red" /> Red<br />
<input type="radio" name="preferred_color" value="Blue" /> Blue<br />
<input type="radio" name="preferred_color" value="Green" /> Green<br />

<p><b>Preferred Item:</b></p>
<input type="radio" name="preferred_item" value="Car" /> Car (The latest Aston Martin!)<br />
<input type="radio" name="preferred_item" value="House" /> House (Waterfront Mansion)<br />
<input type="radio" name="preferred_item" value="Coffee Machine" /> Coffee Machine (umm...but it's a really good one...)<br />
<input type="submit" value="Submit">

<textarea rows="20" cols="60">
Radio Buttons outcome should generate Here

I'm sure it's very simple but I have no clue how to do it!

I would greatly appreciate any help.

Thanks a lot in advance

11-09-2011, 05:12 PM
It depends on how you want this done. If the submit button causes this to happen, it can be done in PHP. If you want it to be instantaneous you will need to program it in javascript.

In either case it takes more then HTML.

You never say what the submit button is used for. And you really don't need a textarea to do this. A div will do.