Optional text field "Other" for select/checkbox form elements

How would I go about setting up an optional "other" text field for either a select menu or multiple check-boxes? I know how to it in straight HTML and javascript but I need the optional value to be recorded in the database.

For example:

You could have a question like:
Fruit you like best:

Then you could have the options:
Apples
Oranges
Strawberries
Other

Then if Other is selected/checked:
Please specify: __________________ (text field)

Thanks in advance!

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free
1-888-533-8098