drop down list selected index change doesn't work in mozilla
Please support our ASP.NET advertiser: DiscountASP.NET – 3 Months Free on ASP.NET 3.5/2.0 Web Hosting
![]() |
Hi
i want to bind a drop down list on the other drop down list selected index change event. i m using the following code---
ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
function is written in a seperate js file.
this works in IE but not in Mozilla... plz give me the solution so that it will work in Mozilla also
Thanks
i want to bind a drop down list on the other drop down list selected index change event. i m using the following code---
ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
function is written in a seperate js file.
this works in IE but not in Mozilla... plz give me the solution so that it will work in Mozilla also
Thanks
if i put that function ( which is written in a seperate js file) in the same file then it works...
i have included the js file also, but if this function is written in the js then it is not working,
please solve my this problem also
and thanks 4 solving my background-color code problem...
bbye
i have included the js file also, but if this function is written in the js then it is not working,
please solve my this problem also
and thanks 4 solving my background-color code problem...
bbye
Thanks & Regards
Umang
Umang
•
•
Posts: 1,080
Reputation:
Solved Threads: 66
This is because you are compiling your page before the javascript runs. Try adding the javascript to your page before you call your code. Example is below:
If Not Page.IsPostBack Then
If Not Page.IsClientScriptBlockRegistered("IncludedJavascript") Then
Page.RegisterClientScriptBlock("IncludedJavascript", "<SCRIPT Language=""JavaScript"" src=""javascriptincludedfile.js""></SCRIPT>")
End If
ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
End If Last edited by SheSaidImaPregy : Nov 8th, 2007 at 12:03 pm.
•
•
Posts: 1,080
Reputation:
Solved Threads: 66
if you wish to know more about this stuff, microsoft has a good article on it.
http://msdn2.microsoft.com/en-us/library/aa478975.aspx
http://msdn2.microsoft.com/en-us/library/aa478975.aspx
Hi, i m using the following code but it is not working...
if(!Page.IsPostBack)
{
if(!Page.IsClientScriptBlockRegistered("scriptcode"))
{
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
}
}
actually that drop down is pasted on a user control and the user control is pasted on a page. i have written this code on the both page user control and the actual page, but it is not working....
what should i do???
if(!Page.IsPostBack)
{
if(!Page.IsClientScriptBlockRegistered("scriptcode"))
{
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
}
}
actually that drop down is pasted on a user control and the user control is pasted on a page. i have written this code on the both page user control and the actual page, but it is not working....
what should i do???
Thanks & Regards
Umang
Umang
if i write on the page
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
Response.Write("<script>alert('hit');</script>");
it shows the message hit.
but if i write the same code on the user control it doesn't show the message.
Page.RegisterClientScriptBlock("scriptcode","<script language=javascript src=\"scriptcode.js\"></script>");
Response.Write("<script>alert('hit');</script>");
it shows the message hit.
but if i write the same code on the user control it doesn't show the message.
Thanks & Regards
Umang
Umang
![]() |
Similar Threads
Other Threads in the ASP.NET Forum
- drop down list question. (ASP.NET)
- How to make selected index zero for dropdown list box in java script..? (JavaScript / DHTML / AJAX)
- Populate One Drop Down List From Another (ASP.NET)
- Populating a Drop-down List (PHP)
- please anybody to help Dropdownlist selected index problem (ASP.NET)
- view employee info for the employee selected from the drop down list (PHP)
- How to get a selected index from checklistbox (ASP.NET)
- Passing a drop down list item's value (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: How to calculate and compare DateTime with Integer(c#)
- Next Thread: Pass value from one page to other page
•
•
•
•
Views: 12593 | Replies: 10 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode