How can I check wheter a combobox is populated?

P

Pasha

hi all

I've got two comboBox in my page.whenever user make a choice in the
first combo,the second combo is populated accordingly.As soon as
second combo populated I'd like to implement some task.My question is
how can detect if second combo finished loding? it' like
window.onload= do some staf


thank in advance
 
T

Tim Down

hi all

I've got two comboBox in my page.whenever user make  a choice in the
first combo,the second combo is populated accordingly.As soon as
second combo populated I'd like to implement some task.My question is
how can detect if second combo finished loding? it' like
window.onload= do some staf

thank in advance

Combo box?

Tim
 
D

David Mark

Combo box?

A SELECT is sometimes rendered as a simple combobox (a read-only
textbox with a button that displays a listbox.) It is an odd term to
use when describing a Web document.
 
P

Pasha

A SELECT is sometimes rendered as a simple combobox (a read-only
textbox with a button that displays a listbox.)  It is an odd term to
use when describing a Web document.

Ok let's put right way.I meant to be a SELECT I used to call it
"combobox" while programming application and as a clue,I am new to
javascript,,just can't figure it out how to do

thank you
 
M

Matthias Reuter

Pasha said:
Ok let's put right way.I meant to be a SELECT I used to call it
"combobox" while programming application and as a clue,I am new to
javascript,,just can't figure it out how to do

My guess is that your scenario is as follows:

You have two selects, the first has several options (the other might be
disabled until a selection has been made). On selecting one option, the
options of the second select are updated, depending on the selection of
the first.

This happens for example on http://eng.autoscout24.com/, when selecting a
car manufacturer, the list of models is set to those of the selected
manufacturer.

Now what is your question:

1. Do you want to know how to detect if the user has made a selection?
2. Do you want to know how to load data depending on a selection?
3. Do you want to know how to add options to a select?

Matt
 
P

Pasha

My guess is that your scenario is as follows:

You have two selects, the first has several options (the other might be  
disabled until a selection has been made). On selecting one option, the  
options of the second select are updated, depending on the selection of  
the first.

This happens for example onhttp://eng.autoscout24.com/, when selecting a  
car manufacturer, the list of models is set to those of the selected  
manufacturer.

Now what is your question:

1. Do you want to know how to detect if the user has made a selection?
2. Do you want to know how to load data depending on a selection?
3. Do you want to know how to add options to a select?

Matt

Hi Matthias

Your scenario is one hundred percent correct.I have two -select- on my
page,the first -select- is several options while other has nothing at
all.Upon making a selection,the options of second -select- is updated
rather by the server itself.Because server updates second select
depending on first -select- selection,it takes a while changeable
depending on first -select- selection.As soon as second -select-
finishes populating,I'd like to run a code depending on second -
select- data.So I have to know exact time as soon as second -select-
finishes populating so that I am able to run my code.Sorry for the
confusion...I hope I've put it across right now
 
M

Matthias Reuter

Pasha said:
Your scenario is one hundred percent correct.I have two -select- on my
page,the first -select- is several options while other has nothing at
all.Upon making a selection,the options of second -select- is updated
rather by the server itself.Because server updates second select
depending on first -select- selection,it takes a while changeable
depending on first -select- selection.As soon as second -select-
finishes populating,I'd like to run a code depending on second -
select- data.So I have to know exact time as soon as second -select-
finishes populating so that I am able to run my code.Sorry for the
confusion...I hope I've put it across right now

I did not understand one thing: How do you fill the second select?

1. After selecting one option of the first select, the corresponding form
is submitted. The server sends a new HTML page containing the same form,
but with the second select now populated.

2. After selecting one option of the first select, that value is
transmitted via an XMLHttpRequest. The server now sends the data for the
options of the second select, which will be used by some javascript to
fill the select.

Matt
 
P

Pasha

I did not understand one thing: How do you fill the second select?

1. After selecting one option of the first select, the corresponding form 
is submitted. The server sends a new HTML page containing the same form,  
but with the second select now populated.

2. After selecting one option of the first select, that value is  
transmitted via an XMLHttpRequest. The server now sends the data for the  
options of the second select, which will be used by some javascript to  
fill the select.

Matt- Alýntýyý gizle -

- Alýntýyý göster -

hi matthias,

Well,when you make selection in the first -select-,server sends html
form containing same form with the secong select now updated..it is in
this case your first scenario
 
M

Matthias Reuter

Pasha said:
Well,when you make selection in the first -select-,server sends html
form containing same form with the secong select now updated..it is in
this case your first scenario

So, then you only need to wait for the load event to execute your
function. Do this like this:

<body onload="loadCallback();">

or like this:

<script type="text/javascript">
window.load = loadCallback;
</script>

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,269
Latest member
vinaykumar_nevatia23

Latest Threads

Top