Printer Friendly Version
Email this thread to a friend
|
Featured Web Site Template |
|
There are 0 guests and 2 members in the forums right now.
Reflects user activity within the last 5 minutes
|
|
| Member |
Message |
mo007
Joined: Dec 13, 2005
# Posts: 52
|
Posted: 2006-Jan-20 13:54
Hi everyone,
I have two drop-down dependent lists (the second list options depend on the choice made from the first list), the options are selected from a MySQL data base. I’ve done this many times in JavaScript, but now I want to do it in php and ONLY php.
My code now can select all the options from the DB and display the first list's options, but I don’t know how to check if the first choice was made so I can display the second list's options accordingly.
Thank you for your help.
|
 |
g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10440
|
Posted: 2006-Jan-20 14:09
PHP is something that runs on the server.
Javascript is something that runs in the browser.
They are completely different things.
Rather than Javascript, CSS might be the answer.
|
 |
mo007
Joined: Dec 13, 2005
# Posts: 52
|
Posted: 2006-Jan-20 14:18
Thank you g1smd, I see your point and I’d rather handle the event on the client-side than the server-side, but not with js.
Please, could you clarify how it’s done in css?
|
 |
dudibob
Joined: Oct 13, 2005
# Posts: 1462
|
Posted: 2006-Jan-20 14:27
try link
|
 |
mo007
Joined: Dec 13, 2005
# Posts: 52
|
Posted: 2006-Jan-20 14:33
Thank you dudibob, but the link you provided does not have a selution to my problem.
|
 |
dudibob
Joined: Oct 13, 2005
# Posts: 1462
|
Posted: 2006-Jan-20 14:38
top left, under HTML tutorials theres learn CSS, it's where I learnt a fair bit from
|
 |
mo007
Joined: Dec 13, 2005
# Posts: 52
|
Posted: 2006-Jan-20 21:00
Thank you guys, but I think that trying to convince my client to use jv is easier than getting the job done on the server-side.
|
 |
dirty_shame
Joined: Aug 28, 2005
# Posts: 191
|
Posted: 2006-Jan-29 01:41
Just call the database with PHP to create the arrays you'll need 9before the page loads) to populate the menus, then write the javascript by referencing the right array to change it live.
|
 |
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
- You have not yet logged in, or registered properly as a member
- You are a member, but no longer have posting rights.
- This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you cannot find this message, click here to Re-Send it.
|
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.
|
Switch to Advanced Editor and ...
Create a New Topic
or Reply to this Thread
|
|