I got it !! It's working beautifully.

<select name='category_name'
onchange="jQuery(model_name).remove();ajax('model', ['category_name'],
'target');">

When the first list is selected, remove the second list rendered by
view and dynamically create it from server side.

On Sep 21, 3:57 pm, juanduke <juan.fu...@gmail.com> wrote:
> Hi Omi:
>
> I dont get want you're trying do, but may this could help you with the
> show/hide actions:
>
> I dont know if is possible to put some javascript code in the controller.
> Something like:
> response.js ="someJSFunctionInTheView();" #this js function show/hides
> element s in the view
>
> If you use the jQuery.load function, there's a 3th (optional) parameter
> where you can put a javascript function, this function is executed when
> finish the loading event, in this function you can put your js code, to
> hide/show element you want.
> the pseudo code is something like this:
>
> jQuery("#target").load( "url to call the controller function", {data passed
> to de controller}, function(){
>    //here your code,
>    jQuery("selector of 2nd select").show()
>
> });
>
> HTH

Reply via email to