C
carmen
I am having a problem with the code below. When the page loads the data it
is pulled from the db just fine. But when I try to update the dropdown list
that has the onchange added to it is not working. Am I leaving something
out.
Any suggestions would be appreciated.
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>
is pulled from the db just fine. But when I try to update the dropdown list
that has the onchange added to it is not working. Am I leaving something
out.
Any suggestions would be appreciated.
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>