Sure, here you go:

//<![CDATA[$("#divstate").bind("change", function (event)
{$.ajax({async:true, data:$("divstate").serialize(), dataType:"html",
success:function (data, textStatus) {$("#divcity").html(data);},
url:"\/index.php\/students\/getcities\/param1"});return false;});
On Dec 7, 2:30 pm, Carlos Lavin <[email protected]> wrote:
> Can you share with us the output javascript the helper creates?
>
> 2011/12/7 GG <[email protected]>
>
>
>
>
>
>
>
>
>
> > I'm trying to build a simple dynamic state / city dropdown menu that
> > pulls from my database... Everything is working except I cannot get
> > the value of the "#divstate" to further populate the city... If I
> > manually enter a # into 'param1', it gets the correct information, and
> > correctly updates the "#divcity"
>
> > Let me know if you need more code, thanks!
>
> > <?php
>
> > echo $this->Form->create('newForm');
> > echo $this->Form->input('teacher', array ('type'=>'select', 'id' =>
> > 'divstate', 'options' => $states ));
> > echo $this->Form->input('classes', array ('type'=>'select', 'id' =>
> > 'divcity', 'empty' => '-- Pick a state first --'));
> > echo $this->Form->end();
> > ?>
>
> > <?php
>
> > $this->Js->get('#divstate')->event('change',
> > $this->Js->request(array(
> >  'action' => 'getcities', 'param1'), array(
> >  'async' => true,
> >  'update' => '#divcity',
> >  'data' => '$("divstate").serialize()',
> >  'dataExpression' => true
> > )));
>
> > ?>
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > [email protected] For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> -Carlos

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to