hi guys,

I have on my web site a facilty where a user can change their trainer name. So 'bill' can change trainer from 'trainer1' to 'trainer4'. that kind of thing.

Currently bill would select the trainer from a dropdown menu where the menu is populated from a mysql statement of available trainers.

How would I create a facility where bill can either select the new trainer from the list or enter an entirely new one in a text box.

Could anyone please give me some advice.

    In the drop down menu of trainers, one of the options should be other. Give it a value of 0, -1, or "other". Something like that.

    Then have a text field next to the drop down menu.

    "If other, please specify: ______________________________"

    Then on the next page, check to see if they selected a trainer from the drop down menu or if they selected "other". If other, then refer to the variable from the text field. You might even want to use that data from the text field to create a new trainer record so that the next time someone sees the drop down menu, the new trainer's name appears in the drop down list.

    If you wanted to get really fancy, you can disable the text field by default and only enable it when someone selects "other" from the drop down menu.

      Write a Reply...