SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Location
    East Midlands, UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Forms with variable outputs?

    Hi Everyone,

    My first post here having only recently joined. Salut!

    I purchased the 'Site Point - Build Your Own Database Driven Website Using PHP & MySQL' book, but was hoping someone would be able to clarify one minor point (major for me!).

    I want to create a simple form where the end user selects one option from a drop down list, this selection will then dictate what the following selection would be.

    For example - You select 'manufacturer of machine' this will then produce another drop down list with models from that particular company/make.

    Can this be done solely in php or do I need to add another application (and ultimately Site Point book!) into the mix?

    Thank you in advance for any advice offered.

    Jim
    computers are for life....not just gaming!

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi there Jim and welcome to Sitepoint

    What you are referring to is called a "Chained Select" and it can be done in PHP alone however it is more suited to Javascript.

    PHP is a server side language meaning that anything it does has to be sent to the server for processing and then sent back to the browser - and a page refresh.
    You will need some Javascript too for the user interaction.

    Have a look at: http://www.dynamicdrive.com/dynamici...ects/index.htm or
    http://www.dhtmlgoodies.com/index.ht...chained_select
    for 2 good examples.

    Spike
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Tags for this Thread

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
  •