ClueLess
03-17-2003, 10:48 PM
This is my very 1st project in XML, ASP, and JavaScript.
I really need your help. I just wonder, has anyone done anything like this before.
I have a dropdown box; we can select diff. value from the dropdown list…. Any values in that dd’s list group (or belongs to that dd’s value), please the XML tree, they will display in the textboxes. How can I do that?
For example: if they select a “PLAN C” then: Medical Expense displays = 40000; Non-Med Expense displays = 20000; and Work Loss display = 250
well, I just posted in the XML forum...but maybe many of you in this forum knows.
Thanks.
====HTM Code===============
<html>
<head>
<title>Untitled</title>
</head>
<script language="javascript">
function changeValue()
{
if (document.all.select.selectedIndex==0)
{
document.getElementById("planA").style.visibility='visible';
}
else
{
document.getElementById("planA").style.visibility='hidden';
}
}
</script>
<body>
<table width=100%>
<tr>
<td>
<select name="select" onchange="changeValue()">
<option value="PLAN A">PLAN A</option>
</select>
</td>
</tr>
</table>
<table>
<tr>
<td width="30"> </td>
<td class="SmallHeadingBurg" width="180">Medical Expense: </td>
<td class="regularParagraph" align="left">$
<INPUT type="text" id="MaxMedExp" name="MaxMedExp" value="">
</td>
</tr>
<tr>
<td width="30"> </td>
<td class="SmallHeadingBurg" width="180">Non-Med Expense: </td>
<td class="regularParagraph" align="left">$
<INPUT type="text" id="MaxNonMedExp" name="MaxNonMedExp" value="">
</td>
</tr>
<tr>
<td width="30"> </td>
<td class="SmallHeadingBurg" width="180"> Work Loss: </td>
<td class="regularParagraph" align="left">$
<INPUT type="text" id="MaxWorkLoss" name="MaxWorkLoss" value="">
</td>
</tr>
</table>
</body>
</html>
====MAX.xml Tree================
<?xml version="1.0"?>
<!--MAX.xlm tree-->
<CODE1>
<PLAN PIPplantype="PLAN A">
<MAXMEDEXP Value="20000" Text="20,000" />
<MAXNONMEDEXP Value="20000" Text="20,000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN B">
<MAXMEDEXP Value="30000" Text="30,000" />
<MAXNONMEDEXP Value="20000" Text="20,000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN C" >
<MAXMEDEXP Value="40000" Text="40,000" />
<MAXNONMEDEXP Value="20000" Text="20,000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN D">
<MAXMEDEXP Value="50000" Text="50000" />
<MAXNONMEDEXP Value="20000" Text="20000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN E">
<MAXMEDEXP Value="50000" Text="50000" />
<MAXNONMEDEXP Value="35000" Text="35000" />
<MAXWORKLOSS Value="350" Text="350" />
</PLAN>
</CODE1>
I really need your help. I just wonder, has anyone done anything like this before.
I have a dropdown box; we can select diff. value from the dropdown list…. Any values in that dd’s list group (or belongs to that dd’s value), please the XML tree, they will display in the textboxes. How can I do that?
For example: if they select a “PLAN C” then: Medical Expense displays = 40000; Non-Med Expense displays = 20000; and Work Loss display = 250
well, I just posted in the XML forum...but maybe many of you in this forum knows.
Thanks.
====HTM Code===============
<html>
<head>
<title>Untitled</title>
</head>
<script language="javascript">
function changeValue()
{
if (document.all.select.selectedIndex==0)
{
document.getElementById("planA").style.visibility='visible';
}
else
{
document.getElementById("planA").style.visibility='hidden';
}
}
</script>
<body>
<table width=100%>
<tr>
<td>
<select name="select" onchange="changeValue()">
<option value="PLAN A">PLAN A</option>
</select>
</td>
</tr>
</table>
<table>
<tr>
<td width="30"> </td>
<td class="SmallHeadingBurg" width="180">Medical Expense: </td>
<td class="regularParagraph" align="left">$
<INPUT type="text" id="MaxMedExp" name="MaxMedExp" value="">
</td>
</tr>
<tr>
<td width="30"> </td>
<td class="SmallHeadingBurg" width="180">Non-Med Expense: </td>
<td class="regularParagraph" align="left">$
<INPUT type="text" id="MaxNonMedExp" name="MaxNonMedExp" value="">
</td>
</tr>
<tr>
<td width="30"> </td>
<td class="SmallHeadingBurg" width="180"> Work Loss: </td>
<td class="regularParagraph" align="left">$
<INPUT type="text" id="MaxWorkLoss" name="MaxWorkLoss" value="">
</td>
</tr>
</table>
</body>
</html>
====MAX.xml Tree================
<?xml version="1.0"?>
<!--MAX.xlm tree-->
<CODE1>
<PLAN PIPplantype="PLAN A">
<MAXMEDEXP Value="20000" Text="20,000" />
<MAXNONMEDEXP Value="20000" Text="20,000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN B">
<MAXMEDEXP Value="30000" Text="30,000" />
<MAXNONMEDEXP Value="20000" Text="20,000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN C" >
<MAXMEDEXP Value="40000" Text="40,000" />
<MAXNONMEDEXP Value="20000" Text="20,000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN D">
<MAXMEDEXP Value="50000" Text="50000" />
<MAXNONMEDEXP Value="20000" Text="20000" />
<MAXWORKLOSS Value="250" Text="250" />
</PLAN>
<PLAN PIPplantype="PLAN E">
<MAXMEDEXP Value="50000" Text="50000" />
<MAXNONMEDEXP Value="35000" Text="35000" />
<MAXWORKLOSS Value="350" Text="350" />
</PLAN>
</CODE1>