I am facing a problem in ASP.NET development:
On my ASPX page, I have 1 GridView & 3 dropdownlists inside that gridview.
Now i wish to change the index of the 2nd dropdownlist based on the index of the 1st dropdownlist.
I want to use JavaScript only. Please help.
Loading
Pradeep ShetPosted Jul 9, 2014, 6:58 AM
But I would suggest the best way is to use jquery, it will make your life simpler
$('#gridid tr td').find('select').each(function(i,v){
var ddlvalue = $(v).val();
});
The above code says, find the grid and get all td within grid then find 'select' element within td
then you will get an array of select & do whatever functionality you want to add.
Harshit MehtaPosted Jul 9, 2014, 2:58 AM
This document.getElementById('ddl1').value works for dropdownlist.
But it doesn't work for my dropdownlist, which is INSIDE the gridview's rows.
Pradeep ShetPosted Jul 9, 2014, 2:53 AM