I still haven't made any progress, any suggestions?
I have two selects, like that:
echo $this->Form->select('myFieldInFirstSelect',
$myOptionsInFirstSelect);
echo $this->Form->select('myFieldInSecondSelect',
$myOptionsInSecondSelect, array('value' => $myValueInSecondSelect));
And I am trying something like:
$this->Js->get('#myFirstSelectId')->event('change',
$this->Js->request(array(
'controller'=>'myCustomController',
'action'=>'myUpdateSelectFunctionWithoutView'
), array(
'update'=>'#mySecondSelectId',
'async' => true,
'method' => 'post',
'dataExpression'=>true,
'data'=> $this->Js->serializeForm(array(
'isForm' => true,
'inline' => true
))
))
);
And in myUpdateSelectFunctionWithoutView, I do:
function myUpdateSelectFunctionWithoutView {
$this->set('myValueInSecondSelect', array('1' => 'option 1'));
}
Any help??
On 18 jun, 03:32, Renato Carvalho <[email protected]> wrote:
> Hello guys,
>
> I am trying to set the 'value' of a select using the cake 2.x
> JsHelper, but unlucky so far.
>
> I`ve managed to change all options of the select, but I have no clue
> on how to change only the 'value'.
>
> I have 2 selects with constant options (the options doesn`t change).
> I want to set the 'value' of the second select, depending on the
> 'value' of the first select.
>
> Does anyone here knows how to do this?
>
> Thanks.
--
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