onclick action for a dropdown box

I have a question
I know the logic on how to implement it yet I don't know how to actually do it.
Can someone help me out please.
So here it is ....

1. I have a pl\sql query that populates a dropdown box by default
2. on click of the dropdown box (the down arrow) I want a different query to populate the dropdown box

How do I implement this .....

what is the syntax for the onclick in a dropdown
Who is Participating?
selhamwyConnect With a Mentor Author Commented:
I got it working

here is the code

if ( $objResult["FIELD"]  == $row ["FIELD"] ) {
	echo '<option selected value="' . $objResult["FIELD"] . '">' . $objResult["FIELD"] . '  </option>'; 
else { 
	echo '<option value="' . $row['FIELD'] . '">' . $row['FIELD'] . '  </option>'; 

Open in new window

Ray PaseurCommented:
I think the answer might be in here:

I'll add the jQuery Zone to the question.
selhamwyAuthor Commented:

thanks but no that does not help.

let me explain further...

the first dropdown  value is different regarding the value
but it always pulls the same second query

let us take this for example

Default Query 1:
Department: IT

Dropdown Query 2:
Department: (lists all departments)

The default is specific to the one person and if you want to change it then it lists all of them.
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
For the dropdown, you would probably want to use change http://api.jquery.com/change/

    //do stuff


Open in new window

As far as populating the drop down, do you want to use ajax or a page refresh?  Does the drop down always show the same data?   There are a lot of ways to do this.  Can you detail what data you need to save if any from one drop down to the other.  Do you mean to have 2 chained dropdowns http://www.appelsiini.net/projects/chained
Ray PaseurCommented:
Can you please post a link to a web page (any page) that demonstrates this?  I don't quite follow the description, but if I see it in action maybe I can show you how it's done.
selhamwyAuthor Commented:
I found a way to resolve in HTML
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.