This is massivly hard coded and bad. If you change the content place holder, or refactor this into a user control this will no longer work. But this is quick.
This is less hard coded which is good, but the code can be a bit tricky to read.
This is probably my favorite method. This tells jquery to search for an input where the id ends with TextBox1 – be careful you have no other TextBox1 ids on the page!
Note the array indexer. This is because jquery returns an array of all the items it finds. This means if you have a grid with 12 rows you can access all of the textbox1’s using
$('input[id$=TextBox1]').value -> $('input[id$=TextBox1]').value
var CustomerInputbox = document.getElementById('<%=ddlCustomer.ClientID %>');
var CustomerID = CustomerInputbox.options[CustomerInputbox.selectedIndex].value;
var CustomerID = $('select[id$=ddlCustomer] option:selected').value
That is all.
P.S. Learn to love jQuery, resistance is futile.