asp:Dropdownlist onChange event not firing in IE but is in Mozilla
asp:Dropdownlist onChange event not firing in IE but is in Mozilla
(OP)
I have an inline popup that has an asp:Dropdownlist that is NOT firing during the onChange event in IE but IS firing in Mozilla. Below is the my code. Any help would be greatly appreciated.
Code from my aspx page
[code]
<body>
<form id="upSellForm" runat="server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<asp:DropDownList id="upsellDescriptionDropdown" runat="server" onChange="javascript:showMe(this);">
</asp:DropDownList>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
function showMe(a)
{
alert("Here I am");
}
</script>
</body>
[code]
Code from my aspx page
[code]
<body>
<form id="upSellForm" runat="server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<asp:DropDownList id="upsellDescriptionDropdown" runat="server" onChange="javascript:showMe(this);">
</asp:DropDownList>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
function showMe(a)
{
alert("Here I am");
}
</script>
</body>
[code]
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
use all lower for the onchange
case sensitivity for IE, and no need to append the javascript: i think.
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
____________________________________________________________
Need help finding an answer?
Try the Search Facility or read FAQ222-2244 on how to get better results.
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
move your javascript to the head tag
CODE
<script type="text/javascript">
function showMe(a)
{
alert("Here I am");
}
</script>
</head>
<body>
<form id="upSellForm" runat="server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<asp:DropDownList id="upsellDescriptionDropdown" runat="server" onChange="javascript:showMe(this);">
</asp:DropDownList>
</td>
</tr>
</table>
</form>
</body>
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
Thanks for your reply ca8msm but when I try to view the rendered HTML from the inline popup I cannot do so to see what the problem is with my page. Any clue on how I can view source from an inline popup page?
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
____________________________________________________________
Need help finding an answer?
Try the Search Facility or read FAQ222-2244 on how to get better results.
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
http://www.energf.com/testingfile.aspx
Does it work for you?
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing Page</title>
<script type="text/javascript">
function showMe(a)
{
alert("Here I am");
}
</script>
</head>
<body>
<form id="upSellForm" runat="server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<asp:DropDownList ID="upsellDescriptionDropdown" runat="server" onchange="showMe(this);">
<asp:ListItem Value="Select Me First"></asp:ListItem>
<asp:ListItem Value="Select Me Second"></asp:ListItem>
<asp:ListItem Value="Select Me Third"></asp:ListItem>
<asp:ListItem Value="Select Me Fourth"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</form>
</body>
</html>
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
jelrod63 is a co-worker of mine, so I'm familiar with his issue. The problem is that his code works fine on a regular aspx page, but when he opens the page that holds this code using some inline javascript (an aspx as a pop up), the event doesnt fire.
I also think he isn't getting the right click option to view source, either.
thanks for your help so far !
T
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
Thanks again for replying I really do appreciate it very much. I'm still getting the same error in IE: "Object expected" but when I changed the following the onchange event is being fired (Notice the part onchange="alert('Here I am')">):
<asp:DropDownList ID="upsellDescriptionDropdown" runat="server" onchange="alert('Here I am')">
<asp:ListItem Value="Select Me First"></asp:ListItem>
<asp:ListItem Value="Select Me Second"></asp:ListItem>
<asp:ListItem Value="Select Me Third"></asp:ListItem>
<asp:ListItem Value="Select Me Fourth"></asp:ListItem>
</asp:DropDownList>
That does me no good though because I need to be able to Javascript functions. Could it not be working because my code is in an inline popup and that is the reason it is not finding the object? I have to use an inline popup for this part of my project though. Now I'm really at a loss.
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
here is the inline popup function you requested
var inlineObj = function(width, height, path, file, params, obj)
{
showAllSelects();
showFlash();
divWidth = width;
divHeight = height;
if (path != '')
url = "/" + path + "/_popups/" + file + "?" + params;
else
url = "/_popups/" + file + "?" + params;
getRequest(obj);
}
Below is a portion of my actual code from my summary.aspx.cs page which is calling the upsells.aspx page through the inline popup (***NOTE: 'upsells.aspx' is the page where the asp:DropDownList is located. The summary.aspx page is located in a folder called packages and the upsells.aspx page is located in a folder within packages in a folder called _popups)
StringWriter sw2 = new StringWriter();
HtmlTextWriter tw2 = new HtmlTextWriter(sw2);
tw2.Write("<td valign=\"top\" width=\"110\" align=\"right\">");
tw2.Write("<img src=\"/images/layout/arrow_orange.gif\"> ");
tw2.Write(" <a href=\"javascript:;\" onclick=\"javascript:inlineObj(330, 250, 'packages', 'upsells.aspx', 'showID=");
tw2.Write(node.SelectSingleNode("showID").InnerText);
tw2.Write("','showUpsellDetails");
tw2.Write(node.SelectSingleNode("showID").InnerText);
tw2.Write("');\" class=\"addTrip\">");
tw2.Write("add to my trip</a> </td>");
tw2.Write("</tr>");
tw2.Write("<tr>");
tw2.Write("<td valign=\"top\" colspan=\"2\" width=\"525\">");
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
so the page pops up okay, and it opens the aspx file, in which the onchange event doenst work unless you place the actual alert inside the event. hmmmm
i bet theres an error, but its just not showin in IE, and mozilla handles it properly, but IE is not. Is it a plain jane page like our examples? any other js getting in the way? maybe write out the js that opened the popup and see if theres any extra spaces or something.
http://www.energf.com/testingfile.aspx
updated to open a popup, the alert still happens, but the popup is not allowing another popup.
You can right click in the pop up and select View Source, but my example wont get you much.
changed
CODE
function showMe(a)
{
alert("Here I am, here comes a popup");
window.open("testingfile.aspx","mywindow","status=0,toolbar=0,width=100,height=100");
}
</script>
RE: asp:Dropdownlist onChange event not firing in IE but is in Mozilla
____________________________________________________________
Need help finding an answer?
Try the Search Facility or read FAQ222-2244 on how to get better results.