Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Listboxes

Status
Not open for further replies.

willya340

Technical User
Jul 2, 2001
17
KW
I tried to implement it but the lists don`t get populated !!!
Maybe because its built for ultradev and not Dreamweaver MX , and maybe its
using an ASP , i want to use PHP and MySQL to populate the dropdownlists ,
any help please , thanks ?!!

I want to implement the tutorial in this macromedia technote using
php/mysql/javascript.


anyone have any idea how to do that :D

Thanks
 
ASP_ and PHP
1.filter a record set
2.just set the default value of a list to be = field in the recordset
"listbox"???- won't get u far but a "list/menu" will
all the best
 
hi lebisol

thanks for the answer.
but it didn`t get me any further.

can you elaborate more please.

shall I create 2 recordsets 1 for the parent list/menu and the second for the child list/menu , but I noticed that there is an ASP code inside the Javascript , how to change this to PHP , or what is the equivilant 2 it?!!!

Thanks
 
Hi willya340 !
I am not familiar with the exact synthax of PHP but I responded since no one else was helping.
I know that it works in ASP and I would think not much different in PHP. This approach, as u know, is used alot in Edit-Update process but as well as for the Dynamic stuff...
so assuming you have
eg.
Table called SUBJECTS with 2 fields. ID and Name (descripotion)
---SUBJECTS----------
[SubjectID][SubjectName]
1 Math
2 History
...
--------------------
you would want users to see:

Please Select Subject:[SubjectName]
while they will be entering values of numbers 1-->

so the steps would be
1) create a RecordSet that selects the table called SUBJECTS
2) then make a regular list in a form
In list properties:
-set Item Label:
<%=(RecordSet.Fields.Item(&quot;SubjectName&quot;).Value)%>
and
-Value:
<%=(RecordSet.Fields.Item(&quot;SubjectID&quot;).Value)%>

and ur done!
I have not read the link u posted but this DOES work 100% in ASP and I am almost positive that it will for PHP!
I hope this explains thing a bit more!
All the best!
 
here is what i have :

a mysql table for category with catid(autoincerment) and catname.

another table for subcat with subcatd(autoincrement) and subcatname and catid

relating them with the catid.

I did a recordset for category table and a second one with the subcat.

now i added 2 list/menu with the first one popylated from the category recordset , now how do i make the second list/menu relate and dependant from the selection of the first list/menu using PHP and javascript?!!

This is my question.
I know u r an ASP expert , thanks for your help , but i need this in PHP !!
 
Hi willya340!
Sorry buddy I don't have experience in PHP but from what you wrote you are OK so far. What I think you need to look into is (yes) JavaScript behavior...since no PHP people here are helping ( yeah ...u heard me :) ) ALL I can offer is antoher link to read up in ASP that I think will be of your benifit...at least to the point of understanding how the process works.
here is the link Don't give up, ur are almost there!
All the best!
 
thanks leibsol , but i still don`t get it , i`ll try to figure it out myself , thanks anyway.

I`ll post this to the php forum , maybe somebody will answer. :D
 
well...I can explain the ASP perspective but it will be just theory so....yeah talk to PHP gurus about &quot;Dynamic/Dependant Lists&quot;
good luck
 
dynamicdrive have a javascript menu script that may be of some use. I, like Lebisol, dont use php so dont know the exact way to implement it, but this may help.

Cheech

[Peace][Pipe]
The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top