- function insertListe(lst,txt,val,skipline)
- {
- try
- {
- insertpos=-1;
- o=new Option(txt,val);
- if(lst.options.length>0)
- {
- decale=false;
- if(skipline==null || skipline<=0) skipline=0;
- for(i=skipline;i<lst.options.length;i++)
- {
- //lst.selectedIndex=i;
- if(!decale)
- {
- if(txt<lst.options[i].text)
- {
- //Insertion
- b=new Option(lst.options[i].text,lst.options[i].value);
- lst.options[i]=o;
- o=b;
- decale=true;
- insertpos=i;
- }
- else
- {
- //On continue
- }
- }
- else
- {
- //Decalage
- b=new Option(lst.options[i].text,lst.options[i].value);
- lst.options[i]=o;
- o=b;
- }
- }
- lst.options[lst.options.length]=o;
- }
- else
- {
- insertpos=0;
- lst.options[lst.options.length]=o;
- }
- lst.selectedIndex=insertpos;
- }
- catch(o)
- {
- alert("An exception occurred in the script. Error name: " + e.name + ". Error message: " + e.message)
- return;
- }
- }
function insertListe(lst,txt,val,skipline)
{
try
{
insertpos=-1;
o=new Option(txt,val);
if(lst.options.length>0)
{
decale=false;
if(skipline==null || skipline<=0) skipline=0;
for(i=skipline;i<lst.options.length;i++)
{
//lst.selectedIndex=i;
if(!decale)
{
if(txt<lst.options[i].text)
{
//Insertion
b=new Option(lst.options[i].text,lst.options[i].value);
lst.options[i]=o;
o=b;
decale=true;
insertpos=i;
}
else
{
//On continue
}
}
else
{
//Decalage
b=new Option(lst.options[i].text,lst.options[i].value);
lst.options[i]=o;
o=b;
}
}
lst.options[lst.options.length]=o;
}
else
{
insertpos=0;
lst.options[lst.options.length]=o;
}
lst.selectedIndex=insertpos;
}
catch(o)
{
alert("An exception occurred in the script. Error name: " + e.name + ". Error message: " + e.message)
return;
}
}