That must work..
Try hardcoding ClientID...
document.getElementById('<%=ddl_day.ClientID%>').value
0
ArshadRank #2,492 · 564 reputationPosted Oct 1, 2010, 6:38 AM EDT
0
Hi,
You have to keep that java script function in side the body or at the end of the body element, then it will work. coz ur doing runtime binding, might be coz of that ur getting that error. just try once.
Suthish NairRank #92 · 22.8K reputationPosted Sep 30, 2010, 4:10 AM EDT
What error you facing... rewrite ur code..
String s = String.Format("javascript:validdate('{0}', '{1}', '{2}')", ddl_day.ClientID , ddl_month.ClientID, ddl_year.ClientID);
ddl_day.Attributes.Add("onchange", s);
ddl_month.Attributes.Add("onchange", s);
ddl_year.Attributes.Add("onchange", s);
Dharmesh SharmaRank #1,974 · 741 reputationPosted Sep 30, 2010, 4:22 AM EDT
Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object
Raghavendra URank #1,371 · 1.2K reputationPosted Sep 30, 2010, 4:36 AM EDT
Dharmesh SharmaRank #1,974 · 741 reputationPosted Sep 30, 2010, 4:51 AM EDT
Raghavendra u
now i m geting this error
Microsoft JScript runtime error: Object expected
Suthish NairRank #92 · 22.8K reputationPosted Sep 30, 2010, 12:51 PM EDT
Try hardcoding ClientID...
document.getElementById('<%=ddl_day.ClientID%>').value
ArshadRank #2,492 · 564 reputationPosted Oct 1, 2010, 6:38 AM EDT
You have to keep that java script function in side the body or at the end of the body element, then it will work. coz ur doing runtime binding, might be coz of that ur getting that error. just try once.
Regards,
Arshad