Note that there are some explanatory texts on larger screens.

plurals
  1. POshow/hide drop down
    primarykey
    data
    text
    <p>here is my code:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt; &lt;HTML&gt; &lt;HEAD&gt; &lt;TITLE&gt; New Document &lt;/TITLE&gt; &lt;script type="text/javascript"&gt; document.getElementById("radio1").onchange = function() { if(this.checked == true) { document.getElementById("list1").style.visibility = "hidden"; document.getElementById("list1").style.display = "none"; } }; document.getElementById("radio2").onchange = function() { if(this.checked == true) { document.getElementById("list1").style.visibility = "visible"; document.getElementById("list1").style.display = "block"; } }; &lt;/script&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;form method = "post"&gt; &lt;br /&gt;&lt;p id="first"&gt;&lt;label&gt;First Name:&lt;/label&gt;&lt;input type="text" name="first" size="30" /&gt;&lt;/p&gt; &lt;br /&gt;&lt;p id="last"&gt;&lt;label&gt;Last Name:&lt;/label&gt;&lt;input type="text" name="last" size="30" /&gt;&lt;/p&gt; &lt;br /&gt;&lt;p id="instructor"&gt;&lt;label&gt;Instructor:&lt;/label&gt;&lt;select name="instructor"&gt; &lt;option value="instructor1"&gt;instructor1&lt;/option&gt; &lt;option value="instructor2"&gt;instructor2&lt;/option&gt;&lt;/select&gt;&lt;/p&gt; &lt;br /&gt;&lt;p id="hospitalorientation"&gt;&lt;label&gt;Hospital Orientation:&lt;/label&gt; &lt;div id='buttons'&gt; &lt;label&gt;&lt;input id="radio1" type="radio" name="hospital" /&gt; Not Complete &lt;/label&gt; &lt;label&gt;&lt;input id="radio2" type="radio" name="hospital" /&gt; Complete &lt;/label&gt; &lt;/div&gt; &lt;div id="list1" style="display: none;"&gt; &lt;label&gt;Month Complete: &lt;select&gt; &lt;option&gt;January&lt;/option&gt; &lt;option&gt;February&lt;/option&gt; &lt;option&gt;March&lt;/option&gt; &lt;option&gt;April&lt;/option&gt; &lt;option&gt;May&lt;/option&gt; &lt;option&gt;June&lt;/option&gt; &lt;option&gt;July&lt;/option&gt; &lt;option&gt;August&lt;/option&gt; &lt;option&gt;September&lt;/option&gt; &lt;option&gt;October&lt;/option&gt; &lt;option&gt;November&lt;/option&gt; &lt;option&gt;December&lt;/option&gt; &lt;/select&gt; &lt;/label&gt; &lt;/div&gt; &lt;/form&gt; &lt;/BODY&gt; &lt;/HTML&gt; </code></pre> <p>I will have more fields like the hospital field, so i will need to do it more than one. I need a drop down to show when a certain radio button is selected. But everything i try in javascript doesnt work. I am new to javascript. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload