/* script migrated from EDC DropDownSelector.js for TVI ATA drop downs- works only in IE FORMAT OF SELECT TAG REQUIRED for all drop downs on included page: */ var tex = ''; var focused = false; var originalVal = focused.selectedIndex; document.onkeydown = function() { if (focused && event.keyCode == 8) { tex = tex.substr(0, tex.length - 1); document.onkeypress1(1); return false; } } document.onkeypress1 = function(f) { // only relevant to specified dropdown controls. // it is crucial to specfify dropdowns to allow text entry elsewhere // on form. var controlName = event.srcElement.name; //IN EDC, if(dropdown) is used to selected certain drop down lists, e.g. if (controlName == "ataId" ) if ( event.srcElement.tagName == 'SELECT' ) { if (!f) { var e = event.keyCode; //setTimeout('timeout()',20000); switch (true) { case (e == 9 || e == 13 || e == 38 || e == 40): return true; break; case (e == 27): // if escape pressed, revert back to original value //window.status = ''; tex = ''; window.status = ''; return true; break; case (31 < e < 127): tex += String.fromCharCode(e); break; default: return false; } } window.status = tex; var i = -1; if (focused.options != null) { while (focused.options[++i]) if (focused.options[i].text.substr(0,tex.length).toLowerCase() == tex.toLowerCase()) { focused.selectedIndex = 0; break; } focused.selectedIndex = i; } return false; } else { if (event.keyCode == 13 && event.srcElement.type != 'submit') { if (event.srcElement.name == "_TxtTVGoto") { document.Register.__EVENTTARGET.value = '_btnGoto'; document.Register.__EVENTARGUMENT.value = ''; document.Register.submit(); } return false; } else { return true; } } } function timeout() { tex = ''; window.status = ''; return true; } function comboReset() { tex = ''; focused = false; window.status = ''; return true; }