Wednesday, June 20, 2012

Re: JsHelper

Well I personally do not use JsHelper as I prefer clean JavaScript but after reading this tutorial form the CakePHP Book the answer would be:

<?php  $this->Js->get('#select1')->event('change', $eventCode);
?>
Where $eventCode should change the value of #select2.


With some clean jQuery code the answer will be:

 $(document).ready(function() {

 $('#select1').change(function(){
$('#select2').val(NEWVALUEHERE);
});

 });


On Monday, 18 June 2012 09:32:04 UTC+3, Renato Carvalho 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.

On Monday, 18 June 2012 09:32:04 UTC+3, Renato Carvalho 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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: