Required Dropdown
This dropdown will be red until it is satisfied
by Ground_Zero
HTML
<table style="border:2px solid #006633" bgcolor="#CCBFA3"; id="my_table">
<tr>
<td>
<label>Was tPA Given:
<select name="cprompt_7_1" id="cprompt_7_1" class="required">
<option value=""></option>
<option value="YES">YES</option>
<option value="NO">NO, REASON MUST BE ENTERED</option>
</select>
</label>
</td>
</tr>
</table>
CSS
body{
background-color:#D1D1D1;
font-size: 62.5%;
margin: 30px;
}
td{
text-align:left;
font-family: Tahoma, Verdana, sans serif;
font-size: 10pt;
vertical-align:top;
}
td.checked { background: yellow; }
select.hide{ display:none; }
JavaScript
// Lasix Frequency Selection
$(function() {
$("select#cprompt_31_1").change(function() {
if ($('select#cprompt_31_1 option:selected').val() == "ORAL") {
$("select#cprompt_31_2").removeClass("hide");
$("select#cprompt_31_3").addClass("hide");
} else {
$("select#cprompt_31_2").addClass("hide");
$("select#cprompt_31_3").removeClass("hide");
}
});
});
$("input:checkbox").click(function() { $(this).parent("td").toggleClass("checked");
});