[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Combo Box event listener

Posted on 2008-11-13
2
Medium Priority
?
991 Views
Last Modified: 2013-11-11
I have this problem
I have a combobox going to a php form, everything submits correctly but the state never changes it always staying at the first state of the combo box  AL in my php email
with the code of
var type = combo.selectedItem.label;
form = new LoadVars();

I knew that the issue was probably  an event Listener, not seeing the change of the combo box.
so i tried
var cbListener = new Object();
cbListener.change = function(evt) {
    var state = evt.target.selectedIndex;  
}
cbFieldList.addEventListener("change",cbListener);
form = new LoadVars();

But now i get
cbListener: [object Object], returned in the php email

Any help would be awesome.
0
Comment
Question by:oldcarguy85
2 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 22953561
I'm assuming you mean that if say item2 is selected it must show 2 selected not the default first one?

i think in your change method you just need to set it

combo..selectedIndex = evt.target.selectedIndex;
trace(evt.target.selectedIndex);//check this is returning the right thing
0
 

Accepted Solution

by:
oldcarguy85 earned 0 total points
ID: 22953827
now it gives me undefined.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question