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.3k
onchage event thorugh cascading dropdown list
Mar 5 2018 3:51 AM
<script type="text/javascript">
function change() {
debugger
var DropdownList = document.getElementById('<%=ACan.ClientID %>');
var SelectedIndex = DropdownList.selectedIndex;
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;
}
if i use onchange event without cascading then value come selectedindex=1 not work for selectedindex=2 or 3 then i wanna do it with cascading dropdown.....
Reply
Answers (
2
)
onchange event for dropdown list
ASP.NET CORE with Redis Hashes