Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Thanked 0 Times in 0 Posts

    Radio buttons to populate in a textarea

    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
    Last edited by GLogan; 11-09-2011 at 02:14 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Thanked 670 Times in 669 Posts
    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.


    Posting Permissions

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