SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Generate different dropdowns based on user input

    I would like to populate form fields based on previous fields completed by the user. ie. User types in name then selects their sex, if they are female, a dropdown displays scents for women, if the user is male, the dropdown displays scents for men. The list of scents is dynamic (stored as variables within the script).

    Is this possible to achieve without them hitting the submit button first?

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Not with PHP. This requires JavaScript since JavaScript runs in the browser and PHP does not. With JavaScript this is easy to do. You can find the code for that in this thread: http://www.sitepoint.com/forums/showthread.php?t=208541

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks stymiee, I'll have a look through that code


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
  •