• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Not ajax Q

Participant ,
Apr 02, 2007 Apr 02, 2007

Copy link to clipboard

Copied

Good morning all.
I have a dropdown select box populated with departments name. So when one select one of the department, the system should query the employees info in the oracle db based on the selected department, and then should display on a div ....Any help will be appreaciated...Thanks.
TOPICS
Advanced techniques

Views

420

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 02, 2007 Apr 02, 2007

Copy link to clipboard

Copied

Hey Emmim, not sure exactly what you are asking in your question. It seems like you are asking a question about how to use AJAX to query a database and return employee data for a selected department to your page. However, your topic title is "Not Ajax", so I'm a little confused. It seems like there are 2 possible solutions to your question:

1) Ajax solution - have a javascript function that is called when your select box value changes that performs an AJAX call (ie. passes a department ID to another CF page, which queries your DB, and returns the employee data in XML (or even HTML)), and then puts that data in a <div> tag

2) Non-Ajax Solution - submit the form when a department is selected, and perform the look up and page formatted in CF on the form's action page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 02, 2007 Apr 02, 2007

Copy link to clipboard

Copied

In your 2nd solution, should i use a div with it...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 02, 2007 Apr 02, 2007

Copy link to clipboard

Copied

In the second solution I listed, you could use whatever formatting you wanted to display the employee information (a table, grid, spreadsheet):

1) User selects department from drop down in form
2) Form is submitted to action Page via regular HTTP post
3) on action Page: query DB, return employees, format employee info in HTML

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 02, 2007 Apr 02, 2007

Copy link to clipboard

Copied

opps.my bad..I want to see the employee info on the same page...after selecting a dept..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 02, 2007 Apr 02, 2007

Copy link to clipboard

Copied

then javascript or ajax are your options.

with js you can pre-buid a 2d array of employees for each department,
and then change the content of your div based on which department was
selected in the listbox.

ajax will do nicely, too.
--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 03, 2007 Apr 03, 2007

Copy link to clipboard

Copied

You can set your first drop down as a jump menu and have it do a post back
to the same page and page and use a IsDefined to have the second dropdown
pull the information. I do that on a couple of my sites since I can't seem
to get the Ajax working. Its ugly but it works perfect for the time being.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 04, 2007 Apr 04, 2007

Copy link to clipboard

Copied

LATEST
Sounds good guys...thanks..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation