[dev] Horde_Form radio with text ("Other" option)

Jan Schneider jan at horde.org
Fri Jan 14 08:45:05 PST 2005


Zitat von Richard Wallace <rwallace at thewallacepack.net>:

> What would be the best way to create a radio button variable with an
> "Other" option that requires the user to fill in the text box.  Right
> now I'm thinking of making the separate text variable required based on
> whether or not the radio button is selected.  So the first time the form
> is viewed, the text box wouldn't be required, but if the user selects
> the "Other" radio button and hits submit, the text variable will be set
> to required so the validation should fail.  Does that sound like a good
> way of doing it?

Well, that sounds like a good workaround. ;-)

A cleaner solution would be to either create a new type or extend the
existing one to support an "other" field by default.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the dev mailing list