Problems with dropdown list

C

carmen

I am having a problem with the code below. When the page loads the data is
pulled from the db just fine But when I try to update the dropdown list that
has the onchange added to it it is now working am I leaving something out. I
am lost.

Thanks
Carmen

<SCRIPT>
function UpdateSample1()
{
var CallTypSelect = document.forms.FrontPage_Form1.CallTyp;
var SeveritySelect = document.forms.FrontPage_Form1.Severity;

SeveritySelect.options.length = 0; // Clear the popup

if (CallTypSelect.options[CallTypSelect.selectedIndex].value == "Question")
{
SeveritySelect.options[0] = new Option(" ");
}
else if (CallTypSelect.options[CallTypSelect.selectedIndex].value ==
"Other")
{
SeveritySelect.options[0] = new Option(" ");
}
else if (CallTypSelect.options[CallTypSelect.selectedIndex].value ==
"Problem")
{
SeveritySelect.options[0] = new Option("S1");
SeveritySelect.options[1] = new Option("S2");
}
}
</SCRIPT>


<form method="POST" action="submitupdate.asp" onsubmit="return
FrontPage_Form1_Validator(this)" language="JavaScript"
name="FrontPage_Form1">
<td width="34%" height="22"><b>
<select size="1" name="CallTyp" onchange="UpdateSample1()">
<option selected><%=RSupdate("CallTyp")%></option>
<%
If RSupdate("CallTyp")= "Question" then
%>
<option>Other</option>
<option>Problem</option>
<% end if %>
<%
if RSupdate("CallTyp")= "Other" Then
%>
<option>Question</option>
<option>Problem</option>
<% end if %>
<%
if RSupdate("CallTyp")= "Problem" Then
%>
<option>Question</option>
<option>Other</option>
<%
End if
%>
</select></b></td>

<td width="34%" height="22"><b>
<%
if RSupdate("Severity1")="S1" then
sever1 ="S1"
End if
if RSupdate("Severity2")="S2" then
sever1 ="S2"
End if
%>
<select size="1" name="Severity">
<option selected> <%=Sever1%></option>
</select></b>
</td>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top