Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First value of option list should always be blank

Status
Not open for further replies.

rosn459

Programmer
Sep 18, 2003
37
0
0
US
The below script is called from an onChange command. I need the first option to always be blank but it's not. How can I make sure the first option is always blank with the below script?

var sub = 0
for (var i = 0;i < ListOne;i++)
{
if (document.form.ListOne)
{
var newoption = new Option();
newoption.value = LO;
newoption.text = LO;
document.form.ListOne.options[sub] = newoption;
sub += 1;
}

I've hardcoded a blank <option> but it is ignored whenever the onchange command is executed.
 
cLFlaVA,

OMG! Thanks - so simple and right in front of me! Gotta switch back to expresso!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top