Combo addOption array value not set

I am using a combo to populate a second combo based on the first combo selection. The selection in the first combo populates the second using the addOption method using an array.

secondCombo.addOption([ {value: "1", text: "First option"}, {value: "2", text: "Second option"} ]);

The Second combo options are populated. I am wanting to use an an onChange or onSelectChange event to preform other functions based on the selected option value.

secondCombo.attachEvent("onSelect", function(value, text){ if(value == "1"){ do this; } });

This is not working. I added an alert to show the option value and it comes back as ‘undefined’. I am setting the value in the addOption method. The option text is being set correctly, why is the option value not being set in the second combo?

Please disregard. I was using the onSelectionChange event that appears to have caused the issue. Changing to the onChange event allows me to pass the option value where the onSelectionChange does not.