[eluser]Jason Tan Boon Teck[/eluser]
I am not sure which is the cause of the failure - CI, XHTML, Javascript, etc.?
What the form does is to trigger a reload of the page whenever a drop down selection is changed. This will retrieved a different set of selections in the second drop down (cascading menu). I gave removed a third drop down, to reduce complexity of testing.
Right now, onChange doesn't seem to work. [removed]() also doesn't seem to display, but alert() does. I have deliberately misspelled some terms to prevent the forum app from stripping away the codes. Can anyone spot my error? Thanks.
View file:
Code:
<?php
echo "\n<body class='html'>";
echo "<sscript language='javascript' type='text/javascript'>";
echo "document. write('JS in body');";
echo "</sscript>";
echo form_open('emr/edit_diagnosis/'.$patient_id);
echo "\n<table class='frame' width='100%' align='center'>";
echo "<tr>";
echo "\n<td width='25%'><b>Diagnosis Chapter <font color='red'>*</font></b></td>";
echo "<td colspan='2' class='red'>";
echo "\n<select name='diagnosisChapter' class='normal' oonChange='jaavascript:selectDiagnosisCategory()'>";
echo "\n<option label='' value='0'>Choice 0</option>";
echo "\n<option label='' value='K00-K93 Diseases of the digestive system'>Choice 1</option>";
echo "\n<option label='' value='C00-D48 Neoplasms'>Choice 2</option>";
echo "</select>";
echo "</td>";
echo "</tr>";
echo "\n<tr>";
echo "\n<td width='25%'><b>Diagnosis Category (ICD-10)<font color='red'>*</font></b></td>";
echo "\n<td colspan='2' class='red'>";
echo "\n<select name='diagnosisCategory' class='normal' oonChange='jaavascript:selectDiagnosis()'>";
echo "\n<option value='' >Please select one</option>";
foreach($dcode1_list as $dcode1)
{
echo "\n<option value='".$dcode1['dcode1_code']."' ";
echo ($diagnosisCategory==$dcode1['dcode1_code'] ? " selected='selected'" : " ");
echo ">".$dcode1['dcode1_code']." [".$dcode1['full_title']."]</option>";
} //foreach
echo "</select>";
echo "</td>";
echo "</tr>";
?>
</table>
<br />
<center>
<input class='button' type='submit' name='submit' value='Enter Diagnosis' />
</center>
</form>
<br />
<sscript language="javascript" type="text/javascript">
<![CDATA[
allert('Javascript is turned on!')
document .write('JS in body');
function selectDiagnosisCategory(){
document.form.status.value="Unfinished";
document.form.diagnosisCategory.selectedIndex = -1;
document.form.diagnosis.selectedIndex = -1;
document.form.diagnosis2.selectedIndex = -1;
document.form.submit.click();
}
function selectDiagnosis(){
document.form.status.value="Unfinished";
document.form.diagnosis.selectedIndex = -1;
document.form.diagnosis2.selectedIndex = -1;
document.form.submit.click();
}
function selectDiagnosis2()
{
document.form.status.value="Unfinished";
document.form.diagnosis2.selectedIndex = -1;
document.form.submit.click();
}
]]>
</sscript>
</body></html>
The