Link to home
Create AccountLog in
Avatar of Pdesignz
PdesignzFlag for United States of America

asked on

Help to populate dropdown list

I am looking for a solution as well as suggestions... I have a dropdown and what I would like is when there is focus on the dropdown that it then displays a description and when it looses focus that it only displays a 3 -4  code... so code could be xyz, but when there is focus you could see and select description of what xyz is. Also, how would this be accomplished without adjusting the size of the dropdown, would like to keep dropdown small size, maybe 3-4 dropdown and on focus shows hidden div that has the options to choose from then select options and loose focus all that is shown is dropdown with xyz

Thanks
Avatar of HonorGod
HonorGod
Flag of United States of America image

I would consider opening a "help/info" section elsewhere on the page when a menu item gets focus.  This section could provide more details about the menu item with focus.
ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I think that they only want the description displayed while focus is on the individual entries, not after something is selected.  So, use onmouseover
to display context sensitive text, and onmouseout to hide the div/text.

SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Pdesignz

ASKER

no, here is what I am looking for, I had a friend work up some code for me and works great, rather than using an input box to display the code or value I would like to use a dropdown so that the user knows that there are options there to select. Also rather than onfocus we used onkeydown. Seems to work in firefox great, but in IE it only displays the hidden div for a split second and then disappears...

So in code that I provided, if we could change from input box to dropdown and help figure out why it only display for a split second in IE

Thanks

<html>
<head>
<script type="text/javascript" src="util.js"></script>
 
<script type="text/javascript">
 
function checkDown(e,txtCtl,listId) {
    var key  = (window.event) ?  event.keyCode : e.keyCode;
 
    var KY_DOWN  = 40;
 
    if (key == KY_DOWN)
        dropDown(txtCtl, listId);
}
 
function checkOk(e,selCtl) {
    var key  = (window.event) ?  event.keyCode : e.keyCode;
 
    var KY_ENTER = 13;
    var KY_TAB = 9;
 
    if (key == KY_ENTER || key == KY_TAB)
      accept(selCtl)
}
 
 
var currentTxtCtl;
var currentDivCtl;
 
function dropDown( txtCtl, divCtlId ) {
 
    var divCtl = document.getElementById(divCtlId);
    setDropBoxPosition( txtCtl, divCtl );
    divCtl.style.display = "";
 
    currentTxtCtl = txtCtl;
    findChildByTagName(divCtl,'select').focus();
    currentDivCtl = divCtl;
}
 
 
function accept(selCtl) {
    if (!currentTxtCtl || !selCtl || selCtl.selectedIndex == -1)
        return;
    currentTxtCtl.value = selCtl.options[selCtl.selectedIndex].value;
    currentTxtCtl.select();
    currentTxtCtl.focus();
 //   closeDropDown();
}
 
function closeDropDown() {
    if (!currentTxtCtl)
      return;
    currentDivCtl.style.display = 'none';
    currentTxtCtl = null;
    currentDivCtl = null;
}
 
function setDropBoxPosition(txtCtl,divCtl) {
    var errMsgLeft = getAbsX(txtCtl);
 
    // clamp if needed
    if (errMsgLeft < 5)
        errMsgLeft = 5;
    if ( (errMsgLeft + divCtl.offsetWidth + 10) >= iecompattest().scrollLeft + iecompattest().clientWidth )
        errMsgLeft = getAbsX(txtCtl) - divCtl.offsetWidth - 10;
 
    var errMsgTop = getAbsY(txtCtl) + txtCtl.offsetHeight;
    divCtl.style.left = errMsgLeft;
    divCtl.style.top = errMsgTop;
}
 
 
</script>
</head>
<body>
 
<table>
    <tr>
        <td>
          <input id="field1" name="field1"
                 size="12" type="text"
                 onkeydown="return checkDown(event,this, 'qualCodes')"
                 onblur="closeDropDown()"
                 tabindex="1101" />
        </td>
        <td style="border:1px solid gray">&nbsp;</td>
        <td>
          <input id="field2" name="field2"
                 size="12" type="text"
                 onkeydown="return checkDown(event,this, 'qualCodes')"
                 onblur="closeDropDown()"
                 tabindex="1102" />
        </td>
        <td style="border:1px solid gray">&nbsp;</td>
        <td>
          <input id="field3" name="field3"
                 size="12" type="text"
                 onkeydown="return checkDown(event,this, 'diagCodes')"
                 onblur="closeDropDown()"
                 tabindex="1103" />
 
        </td>
        <td style="border:1px solid gray">&nbsp;</td>
        <td>
          <input id="field4" name="field4"
                 size="12" type="text"
                 onkeydown="return checkDown(event,this, 'diagCodes')"
                 onblur="closeDropDown()"
                 tabindex="1104" />
        </td>
    </tr>
</table>
 
 
 
<div id="qualCodes" style="display:none;position:absolute;border:none;">
    <select name="select" size="5" id="select"
            onblur="accept(this)"
            onclick="accept(this)"
            onkeydown="checkOk(event,this)"
 
            >
        <option value="HC">Hpick</option>
        <option value="AX">Axeial</option>
        <option value="BC">B C</option>
        <option value="d">d</option>
        <option value="e">e</option>
  </select>
</div>
 
<div id="diagCodes" style="display:none;position:absolute;border:1px dashed red;">
    <select name="select" size="5" id="select"
            onblur="accept(this)"
            onclick="accept(this)"
            onkeyup="checkOk(event,this)"
 
            >
        <option value="0010">0010</option>
        <option value="0011">0011</option>
        <option value="0120">0120</option>
        <option value="0210">0210</option>
        <option value="3010">3010</option>
        <option value="4310">4310</option>
  </select>
</div>
 
<hr/>
 
 
</body>
</html>
 
 
 
 
 
 
 
 
****Contents of js file that is being referenced****
 
 
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
    var i;
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}
 
 
function validate(a)
{
var b="";
if(a.value!="" && (b=isDate(a.value,a.name))!="")
{
alert(b);
a.value="";
}
}
 
function stripCharsInBag(s, bag){
    var i;
    var returnString = "";
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function daysInFebruary (year){
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
    for (var i = 1; i <= n; i++) {
        this[i] = 31
        if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
        if (i==2) {this[i] = 29}
   } 
   return this
}
function changeDate(Obj){
    if(Obj.length == 8){
        Obj = Obj.substring(0, 2)+"/"+Obj.substring(2, 4)+"/"+Obj.substring(4, 8);
    }
    return Obj;
}
function changeDate1(Obj){  
    alert(Obj);
    if(Obj.value.length == 8){
        var cday = Obj.value.substring(0, 2);
        var cmonth = Obj.value.substring(2, 4);
        if(!isNum(cday) && !isNum(cmonth)){
            Obj.value = "0"+Obj.value.substring(0, 1)+"/"+"0"+Obj.value.substring(2, 4)+""+Obj.value.substring(4, 8);
        }
        if(Obj.value.length == 8){
            Obj.value = Obj.value.substring(0, 2)+"/"+Obj.value.substring(2, 4)+"/"+Obj.value.substring(4, 8);
        }
    }
}
function isDate(Obj,str, inStr){
    if(Obj.length == 8){
        Obj = Obj.value.substring(0, 2)+"/"+Obj.value.substring(2, 4)+"/"+Obj.value.substring(4, 8);
    }
    var dtStr = Obj;
 
    var daysInMonth = DaysArray(12)
    var pos1=dtStr.indexOf(dtCh)
    var pos2=dtStr.indexOf(dtCh,pos1+1)
    var strMonth=dtStr.substring(0,pos1)
    var strDay=dtStr.substring(pos1+1,pos2)
    var strYear=dtStr.substring(pos2+1)
    var err = ""
    strYr=strYear
    if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
    if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
    for (var i = 1; i <= 3; i++) {
        if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
    }
    month=parseInt(strMonth)
    day=parseInt(strDay)
    year=parseInt(strYr)
 
    if (pos1==-1 || pos2==-1){
        err+="The date format should be : mm/dd/yyyy in "+inStr+"\n"
    }
    if (strMonth.length<1 || month<1 || month>12){
        err+="Month is Not Valid in "+inStr+"\n"
    }
    if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
        err+="Day is Not Valid in "+inStr+"\n"
    }
    if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
        err+="4 digit year between "+minYear+" and "+maxYear+" is Not Valid in "+inStr+"\n"
    }
    if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
        err+=str+" is Not Valid in "+inStr+"\n"
    }
return err
}
function isDateCheck(DateValue){
    var err = ""
    var strDate = formatDate(DateValue);
    var month = strDate.substring(0,2);
    var day = strDate.substring(3,5);
    var year = strDate.substring(6,strDate.length);
    var now = new Date();
    var currentDate =formatDate(now.getMonth()+1+"/" + now.getDate() + "/"+now.getFullYear());
    var curmon = currentDate.substring(0,2);
    var curday = currentDate.substring(3,5);
    var curyear = currentDate.substring(6,currentDate.length);
    var stryear = curyear-150;
    
    if((year < curyear && year > stryear)||(year == curyear && month < curmon)||(year == curyear && month == curmon && day <= curday)){
        err = ""
    }
    else{   
       err = "Patient DOB is Not Valid \n"       
    }   
    return err;
}
function formatDate(ele){
      var dt = ele;
      if(dt.substring(0,2).indexOf("/")!=-1)
       {
          dt="0"+dt.substring(0,9);
       }
       if(dt.substring(3,5).indexOf("/")!=-1)
       {
         dt=dt.substring(0,3)+"0"+dt.substring(3,dt.length);
         dt=dt.substring(0,10);
       }
       ele.value=dt;
       return dt;
 }
 
function extractValues(fVal)
{
  var submission_string="";
  for (var form_loop=0; form_loop<document.forms.length; form_loop++) 
  {
    for (var elems=0; elems<document.forms[form_loop].length;elems++)
    {
      if (document.forms[form_loop].elements[elems].name != "" && (document.forms[form_loop].name == fVal || document.forms[form_loop].name == 'belig'))
      {
        submission_string += document.forms[form_loop].elements[elems].name + "=<" + document.forms[form_loop].elements[elems].value + "$$";
      }
    }
  }
    return submission_string;
}
function valiValues(fVal)
{
  var err = "";
  for (var form_loop=0; form_loop<document.forms.length; form_loop++) 
  {
    for (var elems=0; elems<document.forms[form_loop].length;elems++)
    {
      if (document.forms[form_loop].elements[elems].name != "" && document.forms[form_loop].name == fVal)
      {
        err+=validateVals(document.forms[form_loop].elements[elems].name,document.forms[form_loop].elements[elems],true)
      }
    }
  }
    return err;
}
 
function validateVals(eName,obj,req)
{
    var err="";
    var eVal = obj.value;
    if(req || eVal!=""){
        if(eName == 'hmomemid'){
            if(document.elig.cMcriteria.value == "5"){
                if(!isValidateMember(eVal)){
                    err+="Subscriber ID is Not Valid \n";
                }
            }
            else if(!isValidateMember(eVal)){
                err+="HMO Member ID is Not Valid \n";
            }
        }   
        if(eName == 'nonhmomemid'){
            if(!isValidateMember(eVal)){
                err+="Member ID is Not Valid \n";
            }
        }   
        if(eVal==""){
            if(fElems[eName].type != "notreqcapchar"){
                if(document.elig.cMcriteria.value == "5" && eName == 'hmomemid'){
                    err +="Subscriber ID is Mandatory \n"
                }
                else{
                    err +=fElems[eName].name+" is Mandatory \n"
                }
            }
        }
        else{               
         if(fElems[eName].type == "date"){
            if(eName == 'Sdob' || eName == 'Ddob'){
                if(eVal != ""){
                    var checkPat = eVal;
                    var patDateOfBirth=changeDate(eVal);
                    if(eName == 'Sdob'){
                        document.elig.Sdob.value = patDateOfBirth; 
                    }
                    else{
                        document.elig.Ddob.value = patDateOfBirth;
                    }
                    var patDate = isDate(patDateOfBirth,'Patient DOB',eName);
                    if(patDate != ""){
                        err+= patDate
                    }
                    else{
                       err+= isDateCheck(patDateOfBirth,'Patient DOB')
                    }
                }
             }
             if(eName == 'Sdob' || eName == 'Ddob'){
                //   alert("Name:"+eName);
             }
             else{
                 if(eVal != "" && eName == 'dosfrom'){
                    document.elig.dosfrom.value = changeDate(eVal); 
                 }
                err +=isDate(obj.value,fElems[eName].name,eName);
             }
        }else if(fElems[eName].type == "capchar"){
                obj.value = obj.value.toUpperCase();
                if(!isAlphaNum(obj.value)){
                    err += fElems[eName].name+" is Not Valid \n"
                }
            }
            else if(fElems[eName].type == "char"){
                obj.value = obj.value.toUpperCase();
                if(!isChar(obj.value)){
                    err += fElems[eName].name+" is Not Valid \n"
                }
            }else if(fElems[eName].type == "notreqcapchar"){
                obj.value = obj.value.toUpperCase();
                if(!isAlphaNumChar(obj.value)){
                    err += fElems[eName].name+" is Not Valid \n"
                }
            }
        }
    }
    return err;
}
function isAlphaNumChar(strValue)
{
    var retval = true;
    var valid_char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'-";
    for (i = 0; i < strValue.length; i++)
    {
       var where = valid_char.indexOf(strValue.charAt(i)) + 1;
       if(where == 0)
        {
          retval = false;
        }
    }
    return retval;
}
function isValidateMember(strValue)
{
    var retval = true;  
    if(strValue != ""){
        var memID = strValue;
        if(!memID == ""){
            var mIDLength = memID.length;       
            if(mIDLength < 8){
                retval = false; 
            }
        }
    }
    return retval && isAlphaNumUp(strValue);
}
 
function isAlphaNumUp(strValue)
{
strValue=strValue.toUpperCase();
return isAlphaNumChar(strValue);
}
 
 
function isAlphaNum(strValue)
{
    var retval = true;
    var valid_char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    for (i = 0; i < strValue.length; i++)
    {
       var where = valid_char.indexOf(strValue.charAt(i)) + 1;
       if(where == 0)
        {
          retval = false;
        }
    }
    return retval;
}
function isChar(strValue)
{
    var retval = true;
    var valid_char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ'-_ ";
    for (i = 0; i < strValue.length; i++)
    {
       var where = valid_char.indexOf(strValue.charAt(i)) + 1;
       if(where == 0)
        {
          retval = false;
        }
    }
    return retval;
}
 
function TrimAllElig(){
for (var elemsForm=0; elemsForm<document.forms.length;elemsForm++)  {
  for (var elems=0; elems<document.forms[elemsForm].length;elems++)  {
   if (document.forms[elemsForm].elements[elems].name != "" && document.forms[elemsForm].elements[elems].type == "text")   {
      s = document.forms[elemsForm].elements[elems].value;
      while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')){
        s = s.substring(1,s.length);
      }
      while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')){
        s = s.substring(0,s.length-1);
      }
      document.forms[elemsForm].elements[elems].value=s;
   }
  }
}
}
 
function resetEligiVals(){
    document.elig.submit();
}
 
function populateCriteriaElig()
{
    var crit="";
    for(i=0;i<document.elig.cMcriteria.length;i++)
    {
    if(document.elig.cMcriteria[i].checked)
        crit=document.elig.cMcriteria[i].value;
    }
    var payName = document.elig.Payers.value;
    var reqProvId = document.elig.providerid.value;
    document.elig.action="../eligibility/eligibility.jsp?eliCriteria="+ crit+"&payerName="+payName+"&provID="+reqProvId;
    document.elig.submit();
}
 
function ValidateFormElig(){
        TrimAllElig();
        var c2 = "";
        for(var j=0;j<document.elig.cMcriteria.length;j++)
        {
        if(document.elig.cMcriteria[j].checked)
        {
            c2=document.elig.cMcriteria[j].value;
        }
        
        }
        
        
        var err = "";
        
        if(document.elig.providerid.value == ""){
                 err+= "Provider ID is Mandatory \n"
        }
        else{
            err+=validateVals("providerid",document.elig.providerid,true)
            err+=valiValues("c"+c2);
        }
    
        if(c2 == "2")
        {
            err=checkError(0,err);
            for(var i=1;i<11;i++)
            {
                err=checkError(i,err) ;
            }
            }
        else if(c2== "3")
        {
        for(var i=0;i<6;i++)
            {
                var error=(i+1);
                var v1=("slname_"+error);
                var v2=("sfname_"+error);   
                var v3=("Sdob_"+error);
 
 
            focusDate(document.getElementById(v3));
            var sLast=document.getElementById(v1).value;
            var sFirst=document.getElementById(v2).value;
            var sDob=document.getElementById(v3).value;
            
            
            
            if (i==0 && (sLast=="" && sFirst=="" && sDob==""))
                err+="Patient Last name, First name, and DOB are Mandatory in row "+error+" \n";
            else if(sLast!="" && sFirst!="" && sDob!="")
            {
                        
                                    
            sLast = sLast.toUpperCase();
            if(!isChar(sLast)){
                err += "Patient Last name is Not Valid  in row "+error+"\n";
            }
            sFirst = sFirst.toUpperCase();
            if(!isChar(sFirst)){
                err += "Patient First name is Not Valid  in row "+error+"\n";
            }
            sDob=changeDate(sDob);
            err+=isDate(sDob,"Patient DOB "," row "+error);
            document.getElementById(v3).value=sDob;
            }
            else if(sLast!="" && sFirst!="" && sDob=="")
                err+="Patient DOB  is required in row "+error+" \n";
            else if(sLast=="" && sFirst!="" && sDob=="")
                err+="Patient DOB and Last name  is required in row "+error+" \n";
            else if(sLast=="" && sFirst=="" && sDob!="")
            {
                err+="Patient First and Last name  is required in row "+error+" \n";
                err+=isDate(sDob,"Patient DOB "," row "+error);
                
            }
            else if(sLast=="" && sFirst!="" && sDob!="")
            {
                err+="Patient Last name  is required in row "+error+" \n";
                err+=isDate(sDob,"Patient DOB "," row "+error);
            }
            else if(sLast!="" && sFirst=="" && sDob!="")
            {
                err+="Patient First name  is required in row "+error+" \n";
                err+=isDate(sDob,"Patient DOB "," row "+error);
                
            }
            else if(sLast!="" && sFirst=="" && sDob=="")
                err+="Patient DOB and First name  are required in row "+error+" \n";
            
            }
            
        }
        
        else
        {
        err+="Criteria must be either Individual or Family \n";
        }
    
        err+=validateVals("dosfrom",document.elig.dosfrom,false)
 
        if(document.elig.esvctype.value == "" && document.elig.svctype.value == ""){
           document.elig.svctype.value="30";
        }
        if(document.elig.esvctype.value != "" && document.elig.svctype.value != ""){
               err+= "Service Type Code Or Code only one Choice is Mandatory \n";
        }
 
        if(document.elig.esvctype.value == ""){
            if(document.elig.svctype.value != ""){
                var retCheck=isAlphaNum(document.elig.svctype.value);
                if(!retCheck){
                  err+= "Service Type Code is Not Valid \n";
                }
            }
        }
        else{
            document.elig.esvctype.value = document.elig.esvctype.value.toUpperCase();
            var retCheck=isAlphaNum(document.elig.esvctype.value);
            if(!retCheck){
              err+= "Code is Not Valid \n";
            }
        }
    
        if(err!=""){
            alert(err);
            return;
        }else{
            //alert("New new utils.js");            
            document.elig.action="rtrequest.do";
            document.elig.submit();
        }
}
 
 
 
function checkError(i,err)
{
var error=(1+i);
var v1=("nonhmomemid_"+error);
var v2=("Sdob_"+error);
var v3=("subMcriteria_"+error);
     
 
                 var memid=document.getElementById(v1).value;
                 var sdob=document.getElementById(v2).value;
                 focusDate(document.getElementById(v2));
                 var sopt="";
                 var a1=document.getElementsByName(v3);
                 for (var j=0;j<a1.length;j++)
                        {
                            if (a1[j].checked)
                            {
                            
                                 sopt = a1[j].value;
                            }
                        
                        }
                if(sopt=="5")
                {
 
                    if(memid!="" && !isValidateMember(memid)){
                        err+="Subscriber ID is Not Valid in row "+error+" \n";
                        }
                    if(i==0 && memid=="")
                    {
                        err+="Subscriber ID is Mandatory in row "+error+" \n";
                    }
              
                }
                    else if(sopt=="2")
                {
 
                 if(memid!="" && sdob!="")
                 {
                        if(!isValidateMember(memid)){
                        err+="Subscriber ID is Not Valid in row "+error+" \n";
                        }
                        sdob=changeDate(sdob);
                        err+=isDate(sdob,"Subscriber DOB "," row "+error);
                        document.getElementById(v2).value=sdob;
                 }
                 else if(memid=="" && sdob!="")
                 {
                     err+="Subscriber ID is required in row "+error+" \n";  
                     sdob=changeDate(sdob);
                     err+=isDate(sdob,"Subscriber DOB "," row "+error);
 
                     
                  }
                 else if(memid!="" && sdob=="")
                     err+="Subscriber DOB  is required in row "+error+" \n";    
                 else if(i==0 && memid=="" && sdob=="")
                 {
            
                    err+="Subscriber ID and DOB are Mandatory in row "+error+" \n";
                 }
                 
                } 
                return err;
}
function openNewWin() {
    if(newwin!=null) {
        newwin.close();
    }
    url = "http://www.healthfusion.com/family_elig/family_elig.html";
    newwin = window.open(url, 'mincalwin','WIDTH=800,HEIGHT=600,RESIZABLE=1, SCROLLBARS=yes,STATUS=0,location=0, toolbar=0');
}
 
function validateEligDetailsFormDonotSubmit(form)
{
document.forms[form].action="../eligibility/eligibilitybenefit.jsp";
document.forms[form].submit();
 
}
 
function fElem(name, type) { 
   this.name = name 
   this.type = type 
} 
 
function multipleSelections(elementId) {
    var selectedId  
    var selectedItem="";    
    var selectList = document.getElementById(elementId)
    var nItem = selectList.options.length
    for (i = 1; i <= nItem; i = i + 1) {        
        if (selectList.options[i-1].selected == true) {
            selectedId = i - 1
            selectedItem += selectList.options[selectedId].value
            selectedItem += ",";
        }       
    }
    return selectedItem;
}
 
// this one correctly gets 1st item and all others then strips final comma.
// (JM) 
function getMultipleSelections(selectList) {
    var selectedItem="";    
    if (selectList == null || selectList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return;
    }
       
    for (var i = 0; i < selectList.options.length; i++) {       
        var opt = selectList.options[i];
        if (opt.selected == true) {
            selectedItem += opt.value + ",";
        }       
    }
    
    return selectedItem.substr(0,selectedItem.length-1);
}
 
function copySelectOptions(destList, sourceList){
    if (destList == null || destList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return null;
    }
    destList.options.length = 0;
    var j = 0;
    for ( i = 0; i < sourceList.length; i++ )  {
        if (sourceList[i] != null)
            destList.options[j++] = new Option( sourceList[i].text,
                                                sourceList[i].value, 
                                                sourceList[i].defaultSelected,
                                                sourceList[i].selected  );
    }
}
 
function getSelectedOption(selectList) {
    if (selectList == null || selectList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return null;
    }
    if (selectList.selectedIndex == -1)  
        return null;
    
    return selectList.options[selectList.selectedIndex];
}
 
// sort options - case insensitive
function sortSelectList(selectList) {
    if (selectList == null || selectList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return;
    } 
    var arrOptions = new Array();
    
    for ( i = 0; i < selectList.length; i++ )  
        arrOptions[i] = selectList.options[i];
    
    arrOptions.sort( cmpAscending );
 
    for ( i = 0; i < selectList.length; i++)  
        selectList.options[i] = arrOptions[i];
}
 
// compare ascending - ignoring case.
function cmpAscending(a, b) {
    var ax = a.text.toLowerCase(); 
    var bx = b.text.toLowerCase();
    if (ax > bx) 
       return 1;
    if (ax < bx) 
       return -1;
    return 0; 
}
 
function removeItemFromList(selectList,itemValueOrText) {
    for (var i = 0; i < selectList.options.length; i++) {       
        var opt = selectList.options[i];
        if (opt.value == itemValueOrText || opt.text == itemValueOrText) {
            selectList.options[i] = null;
            return;
        }
    }
}
 
function itemInList(selectList,itemValueOrText) {
    for (var i = 0; i < selectList.options.length; i++) {       
        var opt = selectList.options[i];
        if (opt.value == itemValueOrText || opt.text == itemValueOrText) 
            return true;
    }
    return false;
}
 
function insertInOrder(selectList,itemToInsert) {
    if (selectList == null || selectList.tagName.toUpperCase() != 'SELECT') {
        alert('expected SELECT control');
        return;
    } 
    if (itemToInsert == null || itemToInsert.tagName.toUpperCase() != 'OPTION') {
        alert('expected OPTION tag');
        return;
    } 
    var i = 0;
    while ( i < selectList.options.length &&
            cmpAscending(selectList.options[i],itemToInsert) <= 0 )
       i++;
    selectList.options.add(itemToInsert, i);
}
 
// change the text of an option, don't select it.
function changeItemText(selectList, oldText, newText) {
    changeItemText(selectList, oldText, newText, false);
}
 
// change the text of an option + optionally select it.
function changeItemText(selectList, oldText, newText, selectIt) {
    if (selectList == null || selectList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return null;
    }
    for (var i = 0; i < selectList.options.length; i++) {       
        var opt = selectList.options[i];
        if (opt.text == oldText) {
            opt.text = newText;
            if (selectIt)
                opt.selected = true;
            return;
        }
    }
}
 
function deSelect(selectList) {
    if (selectList == null || selectList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return;
    }
    selectList.selectedIndex = -1;
}
 
function getSelection(elementId) {  
    var selectList = document.getElementById(elementId);
    var n = selectList.options.length;
    var selectedId;
    var selectedItem = "";
    var i;
    
    for (i = 1; i <= n; i = i + 1) {        
        if (selectList.options[i-1].selected == true) {
            selectedId = i - 1;
            selectedItem = selectList.options[selectedId].value;
            break;
        }
    }
    return selectedItem;
}
 
function setSelection(selectList, valueToSelect) {  
    if (selectList == null || selectList.tagName != 'SELECT') {
        alert('expected SELECT control');
        return;
    }
    var selectedId  
    var selectedItem = "";
    var i;
    
    for (i = 0; i < selectList.options.length; i++) {
        if (selectList.options[i].value == valueToSelect) {
            selectList.options[i].selected = true;
            return;
        }
    }
}
 
 
function arrayIndexOf(ary, item) {      // `cause IE cannot do this.
    var i;
    for (i = 0; i < ary.length; i++) {
        if (ary[i] == item)
            return i;
    }
    return -1;
}
 
function isDecimal(strValue)
{
    var retval = true
    var strs = strValue.split(".")
    if (strs != "" && strs.length > 2) {
        return false
    }
    var valid_char = "0123456789."
    for (i = 0; i < strValue.length; i++) {
        var where = valid_char.indexOf(strValue.charAt(i)) + 1
        if (where == 0) {
            retval = false
        }
    }
    return retval
}
 
var fElems = new Array();
fElems["Sdob"] = new fElem("Subscriber DOB","date");
fElems["Ddob"] = new fElem("Dependent Date Of Birth","date");
fElems["dosfrom"] = new fElem("Date Of Service","date");
// fElems["dosto"] = new fElem("End Date Of Service","date");
fElems["slname"] = new fElem("Subscriber Last Name","char");
fElems["sfname"] = new fElem("Subscriber First Name","char");
fElems["dlname"] = new fElem("Dependent Last Name","char");
fElems["dfname"] = new fElem("Dependent First Name","char");
fElems["dlname"] = new fElem("Dependent Last Name","char");
fElems["dfname"] = new fElem("Dependent First Name","char");
fElems["ssn"] = new fElem("Subscriber SSN","ssn");
fElems["eid"] = new fElem("Employee ID","char");
fElems["esvctype"] = new fElem("Service Type Code","capchar");
fElems["svctype"] = new fElem("Service Type Code","capchar");
fElems["hmosubid"] = new fElem("HMO Subscriber ID","capchar");
fElems["nhmosubid"] = new fElem("Non-HMO Subscriber ID","capchar");
fElems["hmodepid"] = new fElem("HMO Subscriber ID","capchar");
fElems["nhmodepid"] = new fElem("Non-HMO Subscriber ID","capchar");
fElems["providerid"] = new fElem("Provider ID","notreqcapchar");
fElems["payers"] = new fElem("Payer","char");
fElems["hmomemid"] = new fElem("HMO Member ID","capchar");
fElems["nonhmomemid"] = new fElem("Member ID","capchar");
 
function removeTrailingComma(txt) {
    if (txt == null)
        return txt;
    var i = txt.length-1;
    if (txt.charAt(i) == ',')
        return txt.substr(0,i);
    return txt;
}
 
function appendParameter(paramName) {
    return appendParameter(paramName, true);
}
 
function appendParameter(paramName, required) {
    var ctl = top.document.getElementById(paramName);
    if (ctl == null) {
        if (!required)
            return "";
        alert('Element not found:' + paramName);
    }
    else
        return '&' + paramName + '=' + ctl.value;
}
 
function appendAltParameter(paramName, srcName, required) {
    var ctl = top.document.getElementById(srcName);
    if (ctl == null) {
        if (!required)
            return "";
        alert('Element not found:' + srcName);
    }
    else
        return '&' + paramName + '=' + ctl.value;
}
 
function appendFrameParam(frameName, paramName) {
    var fram = frames[frameName];
    if (fram == null) {
        alert('frame:' + frameName + ' is missing.');
        return "";
    }
        
    var ctl = fram.document.getElementById(paramName);
    if (ctl == null) 
        return "";
    else
        return '&' + paramName + '=' + ctl.value;
}
 
function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}
 
function getFileName(str) {
    var idxSlash = str.lastIndexOf("\\");
    if (idxSlash == -1)
        idxSlash = str.lastIndexOf("/");
    if (idxSlash != -1)
        return str.substr(idxSlash+1);
    return str;    
}
 
// use these with schedule_ajax.js
function getXmlDocField(xmlDoc,field) {
    var tags = xmlDoc.getElementsByTagName(field);
    if (tags == null || tags.length == 0)
        return null;
    return tags[0];
}
function updateField(xmlDoc,field) {
    var srcField = getXmlDocField(xmlDoc,field);
    if (srcField != null) {
        var dstCtl = document.getElementById(field);
        if (dstCtl) {
            if (dstCtl.tagName.toLowerCase() == 'input')
                dstCtl.value = fieldValue(srcField);
            else
                if (dstCtl.tagName.toLowerCase() == 'select')
                    setSelection(dstCtl,fieldValue(srcField));
                else
                    dstCtl.innerHTML = fieldValue(srcField);
        }
    }            
}
 
function fieldValue(fld) {
    if (fld.firstChild)
        return fld.firstChild.nodeValue;
    else
        return "";
}
 
 
function findChildByTagName(owner,tagName) {
    var childX;
    var iC;
    for (iC = 0; iC < owner.childNodes.length; iC++) {
        childX = owner.childNodes[iC];
        if (childX.tagName && childX.tagName.toLowerCase() == tagName.toLowerCase())
            return childX;
        if (childX.childNodes.length > 0) {
            childX = findChildByTagName(childX,tagName);
            if (childX != null)
                return childX;
        }
    }
    return null;
}
 
/** Same as getParent() in pmcommon.js, which is depcrated (USE THIS!)
 *
 *  Finds the parent tag of the provided element that is
 *  of the specified tag-name.  It may not be the immediate
 *  parent.  
 */
function findParentByTagName(ctl, tagName) {
    var node = ctl.parentNode;
    while (node != null) {
        if (node.nodeName != null && node.nodeName.toLowerCase() == tagName.toLowerCase())
            return node;
        node = node.parentNode;
    }
    return node;          
}
 
 
function iecompattest(){
    return ( document.compatMode 
          && document.compatMode != "BackCompat" )
               ? document.documentElement 
               : document.body;
}
 
function getAbsX(obj) {
    var leftOffset = 0;
    if (obj.offsetParent) {
        while (obj.offsetParent) {
            leftOffset += obj.offsetLeft;
            obj = obj.offsetParent;
        }
    }
    else 
        if (obj.x)   //for NN4
            leftOffset = obj.x;
 
    return leftOffset;
}
 
function getAbsY(obj) {
    var topOffset = 0;
    if (obj.offsetParent) {
        while (obj.offsetParent) {
            topOffset += obj.offsetTop;
            obj = obj.offsetParent;
        }
    }
    else 
        if (obj.y) // for NN4
            topOffset = obj.y;
 
    return topOffset;
}

Open in new window

or at the very least just be able to display in IE and not worry so much about input box to drop down
I'm sorry, but I'm a bit confused.

Are you asking how to use a dynamic drop down list instead of what you have in the example above?
Thank you for the assist, but I don't think that we helped you resolve your problem.

Good luck & have a great day