?
Solved

onclick action for a dropdown box

Posted on 2013-12-18
6
Medium Priority
?
407 Views
Last Modified: 2013-12-23
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
0
Comment
Question by:selhamwy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39726909
I think the answer might be in here:
http://jquery-plugins.net/jquery-cascading-dropdown-plugin

I'll add the jQuery Zone to the question.
0
 

Author Comment

by:selhamwy
ID: 39726997
Ray,

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.
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39727125
For the dropdown, you would probably want to use change http://api.jquery.com/change/

$('.myDropdown').change(function(){
    //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
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39727132
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.
0
 

Accepted Solution

by:
selhamwy earned 0 total points
ID: 39727481
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

0
 

Author Closing Comment

by:selhamwy
ID: 39735706
I found a way to resolve in HTML
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

752 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