Hi there,
I tried the following file to use your technique. Perhaps I've done all wrong....
This is the file I created to test...
<%@ Page Language="
VB"%>
<html>
<head>
<title>Test Dropdown list</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function DisplayValue()
{
var index_value;
index_value = frm.elements['list'].selectedIndex;
if (index_value = 1)
alert("1");
if (index_value = 2)
alert("2");
}
</script>
</head>
<body>
<form name="frm" id="frm" method="post" runat="server">
<asp:dropdownlist AutoPostBack="false" BackColor="#33FFFF" CssClass="bigdroplisttext" ForeColor="#000000" ID="list" OnSelectedIndexChanged="JavaScript
:DisplayValue(); " runat="server">
<asp:listitem Text="Name1" Value="1"></asp:listitem>
<asp:listitem Text="Name2" Value="2"></asp:listitem>
<asp:listitem Text="Name3" Value="3"></asp:listitem>
<asp:listitem Text="Name4" Value="4"></asp:listitem>
</asp:dropdownlist>
</form>
</body>
</html>
It is giving me the following error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30456: 'JavaScript' is not a member of 'ASP.Test_aspx'.
So, how do I do it then?
Quote:
quote:Originally posted by melvik
happy to be helpful dear friend.
Always:),
Hovik Melkomian.
|
Sankar Sengupta
Striving for the BEST