i did a test page with something like this a while ago, (a bit clunky to look at but it does the job)
depending on the option chosen, a label is updated by a javascript function.
it isn't a text box as you requested, but this may help.
you should be able to view the javascript if you have firebug.
gallerydetailstest.php?ImageID=17