943,884 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 19759
  • ASP.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 7th, 2007
0

drop down list selected index change doesn't work in mozilla

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007
Nov 7th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

try moving the function to your current file and see if it fixes your problem. Also, make sure your file is included before you call the function.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 8th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

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
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007
Nov 8th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

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:
ASP.NET Syntax (Toggle Plain Text)
  1. If Not Page.IsPostBack Then
  2. If Not Page.IsClientScriptBlockRegistered("IncludedJavascript") Then
  3. Page.RegisterClientScriptBlock("IncludedJavascript", "<SCRIPT Language=""JavaScript"" src=""javascriptincludedfile.js""></SCRIPT>")
  4. End If
  5. ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
  6. End If
Last edited by SheSaidImaPregy; Nov 8th, 2007 at 1:03 pm.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 8th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

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
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 12th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

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???
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007
Nov 12th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

first check to see if your code is executing correctly. add a write command right after your scriptcode src segment and run the page. If it posts, and your script isn't executing let me know.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 13th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

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.
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007
Nov 13th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

then I guess the only thing I can suggest to you is put your code on that page instead of in the include file. I've had that problem before and that was the way I solved it. Sorry that I can't be of more assistance. Try the javascript forum as well!
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 13th, 2007
0

Re: drop down list selected index change doesn't work in mozilla

its ok and THANKS A LOT for that much assistance...
see u later with another problem
till than bye and take care
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How to calculate and compare DateTime with Integer(c#)
Next Thread in ASP.NET Forum Timeline: Pass value from one page to other page





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC