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?
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
Bookmarks