Hello.
I want to delete duplicate values of options tag!
this is my code.
But this is not good and have problem!
function DropDups()
{
var i=0;
var forml;
forml = document.getElementsByTagName('form').length;
for(i=0;i<forml;i++)
{
var Target=document.forms[i]['color'];
for (var avvali=1; avvali<Target.options.length; avvali++)
{
valavvali = Target.options[avvali].text;
for (var dovvomi=1; dovvomi<Target.options.length; dovvomi++)
{
valdovvomi = Target.options[dovvomi].text;
if (valavvali == valdovvomi)
{
//alert(valavvali + '==' + valdovvomi);
Target.remove(valdovvomi);
}
}
}
}
//alert(document.forms[1]['color'].options.length);
}
Please help me.
Thanks.