Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
Featured Web Site Template

Hundreds More at Free Site Templates.com!

Web Site Partners
Sponsored Links
Jet City Software
 
Whos Here ?
There are 0 guests and 2 members in the forums right now.
Reflects user activity within the last 5 minutes
Moderator(s): Prowler, jcokos
Member Message

mo007
Joined: Dec 13, 2005
# Posts: 52

View the profile for mo007 Send mo007 a private message

Posted: 2006-Jan-20 13:54
Edit Message Delete Message Reply to this message

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

View the profile for g1smd Send g1smd a private message

Posted: 2006-Jan-20 14:09
Edit Message Delete Message Reply to this message

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

View the profile for mo007 Send mo007 a private message

Posted: 2006-Jan-20 14:18
Edit Message Delete Message Reply to this message

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

View the profile for dudibob Send dudibob a private message

Posted: 2006-Jan-20 14:27
Edit Message Delete Message Reply to this message

try link



mo007
Joined: Dec 13, 2005
# Posts: 52

View the profile for mo007 Send mo007 a private message

Posted: 2006-Jan-20 14:33
Edit Message Delete Message Reply to this message

Thank you dudibob, but the link you provided does not have a selution to my problem.



dudibob
Joined: Oct 13, 2005
# Posts: 1462

View the profile for dudibob Send dudibob a private message

Posted: 2006-Jan-20 14:38
Edit Message Delete Message Reply to this message

top left, under HTML tutorials theres learn CSS, it's where I learnt a fair bit from wink



mo007
Joined: Dec 13, 2005
# Posts: 52

View the profile for mo007 Send mo007 a private message

Posted: 2006-Jan-20 21:00
Edit Message Delete Message Reply to this message

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

View the profile for dirty_shame Send dirty_shame a private message

Posted: 2006-Jan-29 01:41
Edit Message Delete Message Reply to this message

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:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. 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

New posts Forum is locked
© 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions