Three interlinked input and dropdown listbox using Ajax & PHP

JeromeAtom
06:17:15
Hallo,
on this side (http://www.plus2net.com/php_tutorial/ajax_drop_down_list3.php), I have found what I was looking for. But I want to change something. For example, I want first an input. Than the user have to click on a button, and then a second field (dropdown menu) 'pops-up'. The dropdown menu have to filled in with dependent values from an PHP select command.

I do not know, how to realize that.

Please help.
Thanks in advance.


With best regards, Jerome
smo1234
06-17-2015
Is the input filed is related to dropdown list , I mean the data entered in the text box has to be used for populating the options of the dropdown list ? Like search box, the text you enter is used to collect the records from database same way do you want the text to be used for deciding the options of the drop down list box ?

Do you have existing options to fill the drop down ? It can be in xml , csv or database table or text format.

Once the text box is filled and then the dropdown is selected then what you want to do? Submit the form to collect the data ? Or you have any other form component to display ?
JeromeAtom
06-17-2015
The following drop downs should be filled in with select commands from the database i have. I use actually XAMPP, but i want to include this Code into Magento.

After the next Drop is filled by the select, there should be some Infos or Pics, what i actually clicked before. After this i want to fill more Drop downs... like 10 or smth like this

After all i want to get a List what i actually choosed in all drop downs, but this wont be the main problem.

An example for u i programmed is : http://jsfiddle.net/qck252h2/
to start type 6 in

smo1234
06-17-2015
SELECT first_options from TABLE where text_data=6

Execute the php code to get the data ( first_options)

Now you have all options for first dropdown , populate it. Let user select one option which is stored in variable $first_option

SELECT second_options from TABLE where text_data2='$first_option'


Execute the code to get the data ( second_options) and populate the 2nd drop down.

... continue for rest of the dropdown...

This is the basic part but there will be some more issues. Like if the user changes its choice for first dropdown then what will happen to third one ( as it is depended on selection of second one ) ...

This is little complex so better to use jQuery for managing all the dropdowns as the coding part will reduce. But once again I don't have much idea on XAMPP and Magento.

I can help you in query and collecting the records from database in PHP , MySQL

JeromeAtom
06-17-2015
At first, thanks for your help.
I am not very good in webdesign with AJAX und Javascript, so could you maybe help me, and change the quellcode for me (if it is not to much work for you)? Because I do not know how to transpose your help.

I would be very thankful.
smo1234
06-17-2015
One main questions is where the options are stored ? You keep them on the main page or they are taken from another source.
JeromeAtom
06-17-2015
If you mean the options in the dropdowns, they have to come from the database with a select command. The select command is based on the first input.

I hope I have understood your question right.
smo1234
06-17-2015
Yes, Can you send me the sql dump of of table with some sample data ? That is structure of the table with some sample records, you can create sql ump from you phpmyadmin
JeromeAtom
06-17-2015
I have downloaded the .zip-file "ajax-dd3.zip" here (http://www.plus2net.com/php_tutorial/php_drop_down-download.php?download_style=4). And use the sql dump which is in this file.

Or do you want the sql dump, which I want to use for my ready website?

First, I use the sql dumb which is running by the 'original' code from this side.
JeromeAtom
06-17-2015
Maybe we could write by e-mail?
smo1234
06-17-2015
Posted mail, pl check.
JeromeAtom
06-18-2015
ok. I wrote to you.
JeromeAtom
06-22-2015
Hey, I still need help.
Please..
Please Login to post your reply or start a new topic