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:

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

Thanks in advance!

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free