Posted By

mpcircuitry on 12/09/10


Tagged

javascript html


Versions (?)

type ahead textbox to dropdown


 / Published in: JavaScript
 

  1. function PartialClient() {
  2. //Do stuff...
  3. var partialName = document.Form2.txtClientPartial.value;
  4. var c = document.Form2.ddlVendors;
  5. if (partialName != "") {
  6. for (var i = 0; i < c.length; i++) {
  7. if (c[i].text.toUpperCase().indexOf(partialName.toUpperCase()) == 0) {
  8. //document.Form2.attrib_1.selectedIndex = i;
  9. document.Form2.ddlVendors.selectedIndex = i;
  10. break;
  11. }
  12. else if (c[i].value == partialName.toUpperCase()){
  13. document.Form2.ddlVendors.selectedIndex = i;
  14. break;
  15. }
  16.  
  17. }
  18. }

Report this snippet  

You need to login to post a comment.