SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: PHP/Javascript

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2001
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP/Javascript

    I have four tables in my database as follows:

    Writers table

    wID
    name
    email
    pic

    Article type table

    name
    tID

    Article table

    wID
    tID
    aID
    body
    url
    date

    permissions table

    wID
    tID
    access - will either be 1 or 0


    I've just set up an add article page to my content management system. What I'm looking for is how to go about having two drop down menus with one's selection affecting the others.

    First drop down menu would contain all the writer's names(wID) Say I pick "Pete Sottrel". In the permissions table Pete Sottrel has 3-4 different types of articles. Meaning when I pick his name as the wID, the tID will let me choose between all of his article types (story,opinion article etc.) I'd appreciate if anyone could lend me a hand here...
    Bardius

  2. #2
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you'd retrieve all of the tID's and group them into arrays by wID.
    You'd take the PHP arrays and get them into JavaScript.
    Then you'd do an onChange javascript in the wID menu to show the items in the second menu.

    How you'd actually go about doing this I can't totally answer. I know I've seen sites that change a second drop-down menu based on the first but I can't think of any right now.
    Kevin


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •