That's exactly how I'd do it too.
With the exception that I'd put the code in via a touch of jQuery in
the view instead, but that's a matter of style.
Tufty
On Dec 13, 9:02 am, francky06l <[EMAIL PROTECTED]> wrote:
> You could set your text field as an hidden field at first. Then
> handling "onChange" in the select box, with a small javascript you
> would show the text box when the is "other" and hide it otherwise.on
> Something like :
>
> $js = 'if(this.value == "other") $(\'inpbox\').show(); else $(\'inpbox
> \').hide();';
> echo $form->input('knowsfrom', array('type' => 'select', 'options' =>
> $options, 'onchange' => $js));
> echo $form->input('otherfrom', array('type' => 'text', 'id' =>
> 'inpbox'));
>
> I did write this code just straight here, so you might get some syntax
> errors, but that should give you a hint.
> hth
>
> On Dec 13, 7:32 am, rocky <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I'm trying to use cakePHP to do a client's sign up form. I want to
> > know how did our clients find us so we have a selection box for them
> > to choose. Well, there's an option called "other", When they select
> > "Other" as option I want the web page throws an text field for them to
> > fill out.
>
> > If any of you could give me some hint on how to achieve this, I would
> > really appreciate it?
>
> > Blessings,
> > Rocky
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---