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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox & onchange 1

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I am trying:

navigator.onChange = function() {
if (navigator.getValue() == 2) {
trace("2");
}
}

but it does not seem to work... does onChange work with this component?



[conehead]
 
I think you just need to make 2 a string.("2") If that doesn't work you can try the following (adding comboFunction as the change handler in the component properties panel).

Code:
comboFunction(component){
	if(component.getValue() == "2"){
		trace("2");
	}
}

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
I tried the string thing... it seems to be an onChange issue as I traced the value of the combobox and it actually is changing the value as you highlight each option... interesting...

[conehead]
 
Did you try adding the function above and setting the change handler in properties?

Wow JT that almost looked like you knew what you were doing!
 
Of course I should probably fix my bad syntax:

Code:
function comboFunction(component){
    if(component.getValue() == "2"){
        trace("2");
    }
}

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top