www.webdeveloper.com
Results 1 to 3 of 3

Thread: Radio Button Forms

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    5

    Radio Button Forms

    Wolfshade helped me earlier but I did not explain everything correctly (my fault...)

    The following code will output numerical values only for the <label>. I need it to display text with multiple characters. For example:

    I own two exceptional chickens...I own four or more chickens...etc

    Again the code works perfectly but only for numbers.

    Code:
    <script type="text/javascript">// <![CDATA[
     function check(x) { document.getElementById('Radio1').innerHTML = x; }
    // ]]></script>
    
    <form> <input id="r1" onclick="check(one big);" name="r1" type="radio" value="one" /> One
    
    <input id="r1" onclick="check(two exceptional);" name="r1" type="radio" value="two" /> Two
    
    <input id="r1" onclick="check(three terrific);" name="r1" type="radio" value="three" /> Three
    
    <input id="r1" onclick="check(four or more);" name="r1" type="radio" value="four" /> Four
    
    </form>
    
    I own <label id="Radio1" for="r1">blank</label> chickens.
    Any ideas?

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    I guess you want to pass strings as arguments, not objects, nor integers. Strings are always set/defined within quotes:
    Code:
    onclick="check('one big')
    and so an
    Last edited by Kor; 02-02-2011 at 01:40 PM.

  3. #3
    Join Date
    Jan 2011
    Posts
    5
    Thank you for explaining that...Im new to Java (&php)

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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