Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

More...

Forums » .NET » ASP.NET »

How reset name attribute of DropDown in javascript


Posted Date: 17 Aug 2012      Posted By:: Jeevan Joshi     Member Level: Gold    Member Rank: 546     Points: 5   Responses: 1



I want to change name and ID property of DropDown(Select) at runtime using javascript .


IT all working fine in FF,Chrome,IE9 but not in IE8,IE7.

ID gets changed but not NAME property .

I tried all

document.getElementById(id).setAttribute("name", "NewName");
document.getElementById(id).removeAttribute("name");
document.getElementById(id).setAttribute("name","NewName");

document.getElementById(id).removeAttribute("name");
document.getElementById(id).name = "NewName";

.name and .setAttribute shows new name while debugging, but in HTML markup it is OLD so NAME and ID get mismatched on-change event not get triggered.

removeAttribute removes property but not add it again with new name , while debugging it shows but in HTML markup NAME attribut get disappeared.

how to reset NAME property as same as ID in IE8,IE7




Responses

#685960    Author: RayalaHariKishore      Member Level: Gold      Member Rank: 52     Date: 27/Aug/2012   Rating: 2 out of 52 out of 5     Points: 0

hi,
use .nodeName="";

Rayala HariKishore

try..try..try...you achieved it.
http://rayalaharikishore.wordpress.com/



 
Post Reply
You must Sign In to post a response.

Next : IE browser doesn't display the asp.net web page? why?
Previous : How to create cristal Report
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.