By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,744 Members | 1,716 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,744 IT Pros & Developers. It's quick & easy.

6 dropdown boxes populated from PHP/MySQL using Ajax

P: 24
hi
i want to use a dropdown box to populate another dropdownbox and so on but i want to maitain all the data adt was selected from d previoce box and i dnt want to make use of submit button but the dropdown must triger the changes assoon as its value gange

can anyone hlp
Feb 7 '07 #1
Share this Question
Share on Google+
41 Replies


ronverdonk
Expert 2.5K+
P: 4,258
Ever thought of using JavaScript for that? Certainly not PHP.

Ronald :cool:
Feb 7 '07 #2

P: 24
hdf
Ever thought of using JavaScript for that? Certainly not PHP.

Ronald :cool:
hi how can i go about doing dat
Feb 7 '07 #3

ronverdonk
Expert 2.5K+
P: 4,258
Where do you want your dropdown box to be populated from?

From data that is stored in your program or from a server database?

That makes a big difference, because in the first case you simply trigger a JS routine that fills another box.

In the second case you let the triggered JS routine make contact with the server to get the data (using Ajax) and then let that populate the next dropdown.

For both options is a solution.

Ronald :cool:
Feb 7 '07 #4

P: 24
hdf
Where do you want your dropdown box to be populated from?

From data that is stored in your program or from a server database?

That makes a big difference, because in the first case you simply trigger a JS routine that fills another box.

In the second case you let the triggered JS routine make contact with the server to get the data (using Ajax) and then let that populate the next dropdown.

For both options is a solution.

Ronald :cool:
i want it to read from the database
Feb 7 '07 #5

ronverdonk
Expert 2.5K+
P: 4,258
In order to understand the process of Ajax, see demo's named Dynamic client lookup and Chained select boxes at site Ajax scripts

The first one uses the server database top get the info. The second fills a drop down.

When you have questions left, come back here.

Ronald :cool:
Feb 7 '07 #6

P: 24
hdf
In order to understand the process of Ajax, see demo's named Dynamic client lookup and Chained select boxes at site Ajax scripts

The first one uses the server database top get the info. The second fills a drop down.

When you have questions left, come back here.

Ronald :cool:
hi how do i link up 5 dropdown boxs to eachother.e.g
dropdown1 i select the value and it populate dropdown2 dan i select from dropdown2 and it poulates dropdown3 ans son

how can it b done and it must contain the selection tru outh the proces

Thank you
Feb 8 '07 #7

ronverdonk
Expert 2.5K+
P: 4,258
I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

The code for this contains 3 simple scripts:
  1. client script building the screen and executing the JS requests to the server
  2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
  3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.
When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

Ronald :cool:
Feb 8 '07 #8

acoder
Expert Mod 15k+
P: 16,027
Why not just include an attachment (in a zip file) instead of having to email everyone who asks for it?
Feb 8 '07 #9

P: 3
roven. i need the code.



javaram



I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

The code for this contains 3 simple scripts:
  1. client script building the screen and executing the JS requests to the server
  2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
  3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.
When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

Ronald :cool:
Feb 8 '07 #10

P: 24
hdf
I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

The code for this contains 3 simple scripts:
  1. client script building the screen and executing the JS requests to the server
  2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
  3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.
When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

Ronald :cool:
hi
is send u the pm n waiting for the code thnx
Feb 9 '07 #11

P: 17
hi all

i need the code for 6 drop down list box using AJAX.I have done something similar to this using 3 drop downe.But values are not retaining.please help me out and please show me some examples.

Thanks
Feb 13 '07 #12

ronverdonk
Expert 2.5K+
P: 4,258
then pm your email address.

Ronald :cool:
Feb 13 '07 #13

P: 17
then pm your email address.

Ronald :cool:
I have send it.But the code you have given look like jung values.I am not able to read.please send me once more as a Zip file or Rar files

Thanks and Regards
ANIL
Feb 14 '07 #14

P: 17
you have send the code twice But i am not able to raed it.which alnguage is this?
please help me.i am in a deep trouble
Feb 14 '07 #15

ronverdonk
Expert 2.5K+
P: 4,258
Once I have send it as a ZIPped file, the second time all separate files (.php, .js and .sql). You must have a problem in your mail client or in your firewall.

All other requestors have received it in the correct format. (ZIP or separate files).

Ronald :cool:
Feb 14 '07 #16

ronverdonk
Expert 2.5K+
P: 4,258
We solved it. I sent the files as attachments using Outlook Express to a gmail account. That screwed it really up. All files were send as binaries. Whatever I did a the OE side, it did not help.

So I send them again from my own gmail account and that worked fine.

So anyone who runs into this sort of problem (screwed up attached files sent from Outlook express to gmail), get a gmail account!

Ronald :cool:
Feb 14 '07 #17

P: 1
Hi,

I was wondering if it would be possible to get a copy of this code for the 6 linked drop-down boxes. i only need it for 3 where the 2nd and 3rd values are fetched form a MySQL db dependent on the previous option.

Thanks in advance.
Mar 5 '07 #18

ronverdonk
Expert 2.5K+
P: 4,258
Hi,

I was wondering if it would be possible to get a copy of this code for the 6 linked drop-down boxes. i only need it for 3 where the 2nd and 3rd values are fetched form a MySQL db dependent on the previous option.

Thanks in advance.
You can have this code 'as is', i.e. 6 drop downs, each one filling from MySQL select. Send me a pm with your email and I'll send you an Omnidrive link.

Ronald :cool:
Mar 5 '07 #19

P: 1
hi! I would like you will send me this script, ajax 6 drop down box.please, at <email_removed>.
Merci man
Mar 16 '07 #20

P: 1
Hello, Can you please send me the script for the dropdown chain as well..

my email is removed by admin

Thank Yuo very much,
Adam
Mar 20 '07 #21

P: 1
then pm your email address.

Ronald :cool:

Please send me your example. I've been messing around with an example
You select countries, 2nd box fills with cities. The original example code didn't interface with mysql.

If you would share your " 6 dropdown boxes populated from PHP/MySQL" , I could get on with the rest of my project.

Thanks in advance for your help.
Mar 22 '07 #22

P: 1
Hi there can i get also get a copy of your code
Mar 28 '07 #23

P: 1
i also need that code for the dropdowns at <email_removed> i need it like yesterday does it come with an example on how to use it? Thanks
Sep 15 '07 #24

ronverdonk
Expert 2.5K+
P: 4,258
i also need that code for the dropdowns at fulcher1738@yahoo.com i need it like yesterday does it come with an example on how to use it? Thanks
Sent to requestor.

Ronald
Sep 15 '07 #25

P: 28
I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

The code for this contains 3 simple scripts:
  1. client script building the screen and executing the JS requests to the server
  2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
  3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.
When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

Ronald :cool:
Hi, ronver..
I really need the code..
would you send me, pls? I'v just sent my email to U (PM)...
-thanks-
Sep 19 '07 #26

P: 11
Well if you are familiar with Ajax, then you can use the Update Panel. How many update panels are to be put entirely depends upon your functionality. This will serve your purpose but be careful while placing them. After putting drop downs in update panel, make the UPDATE MODE property of update panel CONDITIONAL and drop down list AUTO POST BACK Property TRUE. Then bind the dropdown with your database.Hope this works out for you!
Sep 19 '07 #27

ronverdonk
Expert 2.5K+
P: 4,258
Well if you are familiar with Ajax, then you can use the Update Panel. How many update panels are to be put entirely depends upon your functionality. This will serve your purpose but be careful while placing them. After putting drop downs in update panel, make the UPDATE MODE property of update panel CONDITIONAL and drop down list AUTO POST BACK Property TRUE. Then bind the dropdown with your database.Hope this works out for you!
Can you give us a hint as to what problem/qeuestion in this forum your post is related? I cannot find any question related to any Update panel or Update mode. Otherwise, could you explain what you are referring to?

Ronald
Sep 19 '07 #28

P: 28
hi Ron,,,

I've received the code. Thx, thx... :)

But, may I ask u something more? Would u give me a reference to learn about ajax? a site or something else...

I'v try ur code and I'll try it on my project...
Sep 21 '07 #29

bugboy
100+
P: 160
Heya ronverdonk,

I would love to have a look at the 6 dropdown cascade code, if you could email it to me at <email_removed> that would be great. I really appreciate it.

Thanks! BugBoy
Sep 21 '07 #30

acoder
Expert Mod 15k+
P: 16,027
But, may I ask u something more? Would u give me a reference to learn about ajax? a site or something else...
Check out the Ajax tutorial links in Offsite Links in the Javascript/Ajax forum. You can also see an example in the Articles section.
Sep 23 '07 #31

P: 5
Hi ,can i too, get a copy of your code.

Could you please mail me the code to <email_removed>

Thanks!!
John.
Oct 3 '07 #32

ronverdonk
Expert 2.5K+
P: 4,258
Hi ,can i too, get a copy of your code.

Could you please mail me the code to <email_removed>

Thanks!!
John.
Sent it to you.

Ronald
Oct 3 '07 #33

P: 1
I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

The code for this contains 3 simple scripts:
  1. client script building the screen and executing the JS requests to the server
  2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
  3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.
When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

Ronald :cool:
i stumbled upon this thread, and read about your 6 select boxes.

i too need your help on the codes. i've pmed you already :)

thank you~
Oct 5 '07 #34

P: 5
I aslo need this code badly
i sent you a pm ..

Thnaks
Oct 9 '07 #35

P: 1
Please send me the code also. I am working on a three drop down. <email_removed>
Oct 9 '07 #36

P: 1
hai,

send me the code tooo.... <email_removed> ... Thnx Thnx
Oct 10 '07 #37

P: 5
Hi,

I would appreciate if u could send the code. My id is <email_removed>
Thanks
Oct 13 '07 #38

P: 1
Hi,

Can you please send me to the code as well. I'd be very appreciated!

<email_removed>
Oct 19 '07 #39

P: 1
Hi,

My name is wan. Can you please send me to the code as well. I'd be very appreciated! Here's my email: <email_removed>
Oct 25 '07 #40

P: 1
Hi there,

Please could you send me the code as well, it would be most appreciated.

My email address is: <email_removed>

Many thanks,
Denzil
Oct 25 '07 #41

P: 3
can anyone please send me the code also. my email is <email_removed>
Nov 19 '09 #42

Post your reply

Sign in to post your reply or Sign up for a free account.