/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function PartialClient() { //Do stuff... var partialName = document.Form2.txtClientPartial.value; var c = document.Form2.ddlVendors; if (partialName != "") { for (var i = 0; i < c.length; i++) { if (c[i].text.toUpperCase().indexOf(partialName.toUpperCase()) == 0) { //document.Form2.attrib_1.selectedIndex = i; document.Form2.ddlVendors.selectedIndex = i; break; } else if (c[i].value == partialName.toUpperCase()){ document.Form2.ddlVendors.selectedIndex = i; break; } } }