I am trying to figure out if there is any way to build input for a drop down box on the fly.
What I want to do is allow the user to enter some search criteria in drop down boxes, then build a third drop down box with the search results.
I'm working on a scrip to build sports rosters. We have 10 sports, 5 boys (football, basketball, baseball, soccer, & golf) and 5 girls (cheerleading, volleyball, basketball, softball, and soccer) and 1-5 teams within each sport (Varsity to Middle school). I don't want to duplicate the athlete info, i.e. name, grade, height, weight, so have 2 db tables, one for athletes and one for rosters. The athlete table contains the personal info about the athlete, and the roster table about the sport (sport, team (Varsity etc...), Boys or Girls team, jersey number, position).
I want the user to search the athletes table for athletes already in the system before they try to enter a new athlete, based on grade and the first few letters of the last name. From that info, I want the user to be able to select from the list of possible matches or select 'enter new athlete'.
I know I can do this if I split it up in two pages, but does anyone know of a way to dynamically build the third drop down all on one page? I've looked at a few javascripts that build a second list from a first list, but am struggling with how I could incorporate this into my php script.