how do I get the values of these radio buttons?
<p>I'm having some trouble with getting the value of my radio buttons here:  <a href="http://testing.feministbitch.com/index.php/quiz_creator" rel="nofollow">http://testing.feministbitch.com/index.php/quiz_creator</a>. I have the full code at the very bottom.</p>

<p>When you click add question, I made it so that people can choose the following radio buttons: true/false or multiple choice. </p>

<p>I'm trying to do this: Based on whether they choose true/false or multiple choice, further radio buttons or inputs+drop downs would come down underneath the question. But i'm failing. Please help me :).</p>

<p>The problem here is that I don't know what to set var x equal to get the true_false value or multiple_choice value. </p>

<p>I tried, but these didn't work.</p>

<pre><code> //var x = $("#question_type"+count).value;
 //var x=document.forms["quizquiz"]["question_type" + count].value;
</code></pre>

<p>Here's the part in my code that appends the true/false stuff or multiple stuff based on what radio button they picked: </p>

<pre><code> if (x=="true_false"){
 $('#container').append(
 'The above statement is '+ '&lt;Input id="true_or_false_' + count + '" type = "Radio" Name ="true_or_false[]" value= "true"&gt;' + 'True' + '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'
 + '&lt;Input id="true_or_false_' + count + '" type = "Radio" Name ="true_or_false[]" value= "false"&gt;'+ 'False&lt;br /&gt;&lt;br/&gt;'
 );
 }else{
 $('#container').append(
        'A: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' +
        'B: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' +
        'C: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' +
        'D: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' + '&lt;br /&gt;'
       +'Correct Choice: '
        +'&lt;select name="correct_choice[]"&gt;'
        +'&lt;option value="A"&gt;A&lt;/option&gt;'
        +'&lt;option value="B"&gt;B&lt;/option&gt;'
        +'&lt;option value="C"&gt;C&lt;/option&gt;'
        +'&lt;option value="D"&gt;D&lt;/option&gt;'
        +'&lt;/select&gt;'
        +'&lt;br /&gt;&lt;br /&gt;'
        );
 }
</code></pre>

<p>Here's the full code:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;

 &lt;title&gt;Quiz Creator&lt;/title&gt;
 &lt;script type="text/javascript" src="http://testing.feministbitch.com/js/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
var count = 0;
$(function(){
 $('p#add_field').click(function(){
 count += 1;
 $('#container').append(
 '&lt;strong&gt;Question ' + count + '&lt;/strong&gt;&lt;br /&gt;' 
 + 'Question text: ' + '&lt;input id="question_field_' + count + '" name="question_fields[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;'
 + '&lt;Input id="question_type_' + count + '" type = "Radio" Name ="questiontype_fields'+count+'[]" value= "true_false"&gt;' + 'True/False' + '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'
 + '&lt;Input id="question_type_' + count + '" type = "Radio" Name ="questiontype_fields'+count+'[]" value= "multiple_choice"&gt;'+ 'Multiple Choice&lt;br /&gt;&lt;br/&gt;'

 );

 //var x = $("#question_type"+count).value;
 var x=document.forms["quizquiz"]["question_type" + count].value;

 var a=3;
 alert(a);
 if (x=="true_false"){
 $('#container').append(
 'The above statement is '+ '&lt;Input id="true_or_false_' + count + '" type = "Radio" Name ="true_or_false[]" value= "true"&gt;' + 'True' + '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'
 + '&lt;Input id="true_or_false_' + count + '" type = "Radio" Name ="true_or_false[]" value= "false"&gt;'+ 'False&lt;br /&gt;&lt;br/&gt;'
 );
 }else{
 $('#container').append(
        'A: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' +
        'B: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' +
        'C: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' +
        'D: ' + '&lt;input id="multi_choices_' + count + '" name="multiple_choices[]' + '" type="text" maxlength="300" size="150"/&gt;&lt;br /&gt;' + '&lt;br /&gt;'
       +'Correct Choice: '
        +'&lt;select name="correct_choice[]"&gt;'
        +'&lt;option value="A"&gt;A&lt;/option&gt;'
        +'&lt;option value="B"&gt;B&lt;/option&gt;'
        +'&lt;option value="C"&gt;C&lt;/option&gt;'
        +'&lt;option value="D"&gt;D&lt;/option&gt;'
        +'&lt;/select&gt;'
        +'&lt;br /&gt;&lt;br /&gt;'


        );
 }


 });
});
&lt;/script&gt; 



&lt;/head&gt;



&lt;body&gt;



&lt;div id="upload"&gt;
 &lt;h1&gt;Quiz Creator&lt;/h1&gt;


    &lt;?php

    $attributes = array('name' =&gt; 'quizquiz', 'id' =&gt; 'quizquiz');

    echo form_open_multipart('quiz_creator');
    //controller named quiz_creator

    ?&gt;
    Quiz Name: &lt;input id="quiz_name" name="quiz_name" type="text" maxlength="100" size="100"/&gt;&lt;br /&gt;&lt;br /&gt;
    &lt;?php

//-------------------------------------------------study guide uploader
 for ($i = 1; $i &lt;= 5; $i++) {   
 echo 'Study Guide '.$i.': '. form_upload('studyguide'.$i.'') . "&lt;br /&gt;";
 }
//-------------------------------------------------study guide uploader

echo "&lt;br /&gt;";

?&gt;    


        &lt;div id="container"&gt;
            &lt;p id="add_field"&gt;&lt;a href="#"&gt;&lt;span&gt;&amp;raquo; Add a Question&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
        &lt;/div&gt;


    &lt;br /&gt;&lt;br /&gt;


&lt;?php
echo "&lt;br /&gt;&lt;br /&gt;";
    echo form_submit('upload', 'Upload');
    echo form_close();
    ?&gt;


&lt;/div&gt;






&lt;/body&gt;



&lt;/html&gt;
</code></pre>
