Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 01:05 PM
carmen
Guest
 
Posts: n/a
Default Problems with dropdown list

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>


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles