TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ankita Singh
NA
159
19.1k
onchange event for dropdown list
Mar 5 2018 2:12 AM
var DropdownList = document.getElementById('<%=ACan.ClientID %>');
var SelectedIndex = DropdownList.SelectedIndex;---- (if debug the code thn here value is not defined)
var divtenper = document.getElementById('divtenper');
var divyear10 = document.getElementById('divyear10');
var divpertwelth = document.getElementById('divpertwelth');
var divyearof12 = document.getElementById('divyearof12');
var divgraper = document.getElementById('divgraper');
var divyearofgra = document.getElementById('divyearofgra');
//divtenper.style.display = Course.value == "1" ? "block" : "none";
if (SelectedIndex == 1) {
divpertwelth.style.display = "none";
divyearof12.style.display = "none";
divgraper.style.display = "none";
divyearofgra.style.display = "none";
divyear10.style.display = "block";
divtenper.style.display = "block";
}
else if (SelectedIndex == 2) {
divpertwelth.style.display = "block";
divyearof12.style.display = "block";
divyear10.style.display = "none";
divtenper.style.display = "none";
divgraper.style.display = "none";
divyearofgra.style.display = "none";
}
else if (SelectedIndex == 3) {
divgraper.style.display = "block";
divyearofgra.style.display = "block";
divpertwelth.style.display = "none";
divyearof12.style.display = "none";
divyear10.style.display = "none";
divtenper.style.display = "none";
}
// return true;
}
</script>
then not show my div
Reply
Answers (
3
)
Three Tier Structure (from code behind to data access)
onchage event thorugh cascading dropdown list