By zbricoleur on
I'm just starting to get into the Form API, and my first real difficulty is how to gracefully present those choices that look like:
[ ] Option A
[ ] Option B
[x] Other (please specify [____________])
This is a very common schema with forms; has anyone got a clean way to do it? By "clean," I mean:
A) the textfield for "please specify" is presented inline with the radio button and its label, as depicted in the example.
B) the solution doesn't resort to stuffing HTML into the form item array.
Thanks for any and all help or suggestions.
Comments
Have you looked at CCK and
Have you looked at CCK and the variety of CCK modules? I guess the operational word here is "graceful," as you suggest.
----------------------------------------------------------------------
http://www.bwv810.com/
I am a writer and researcher. In my spare time I build websites with Drupal.
Je peux communiquer en français. / Я могу связывать на русском языке.
Yes, thanks, but...
Thanks for the suggestion, bwv. Yes, I'm pretty familiar with CCK and it's attendant modules, but if there is a module out there that does this particular thing, I haven't found it. I guess that is one of my hopes for this thread--that someone will bring just such a module to my attention. Otherwise, I will need to be making a module, but I'm looking at a looming deadline and I'm not that proficient at module creation yet.
Maybe this helps
I ran across http://drupal.org/node/98253 a while back. Haven't fully read it yet (just bookmarked it), but maybe it helps. It does rely on CCk, but as I understand it it allows you to style CCK forms the way you want to.
That is an excellent find,
That is an excellent find, thanks.
----------------------------------------------------------------------
http://www.bwv810.com/
I am a writer and researcher. In my spare time I build websites with Drupal.
Je peux communiquer en français. / Я могу связывать на русском языке.
Thanks!
That will come in very handy!
A solution
Well, I went back and pored over the CCK module list, and found Explainfield. http://drupal.org/project/explainfield
Functionally, it is exactly what I was looking for. It places the text field below the list of options, instead of inline after the "Other" selection, but it is nicely styled and it doesn't show up at all unless the Other option is selected. (And it allows you to set any option--not just "Other"--as the trigger.)
So that solves that problem, as far as I'm concerned.
Another gem buried in the
Another gem buried in the drupal terra firma. Thanks and congrats!
----------------------------------------------------------------------
http://www.bwv810.com/
I am a writer and researcher. In my spare time I build websites with Drupal.
Je peux communiquer en français. / Я могу связывать на русском языке.