Scott, here is observeField() code below that triggers a call in the
controller to get product categories, classes, types, brands, styles
and sub-brands. And from David's response I need to change the
'loaded' option to 'complete' and figure out what kind of javascript
error I'm getting...

echo $form->select('Product.department_id',
                                                $departments,
                                                null,
                                                array(  'id' => 'dept_sel'),
                                                'Choose Department');

$options = array('url' => '/products/getcategories',
                                        'update' => array(      'cat_div',
                                                                        
'pclass_div',
                                                                        
'ptyp_div',
                                                                        
'brnd_div',
                                                                        
'pstyle_div',
                                                                        
'sub_brnd_div'),
                                        'type' => 'asynchronous',
                                        'loaded' => 'updateInfo();',
                                        'indicator' => 'loading');

echo $ajax->observeField('dept_sel', $options);

The pstyle table row is:

        <tr id="product_style_dsp">
                <td class="label">Product Style:</td>
            <td>
                <?php
                                        echo $ajax->div('pstyle_div');
                                        echo 
$form->select('Product.product_style_id',
                                                        array($pstyle_options),
                                                        null,
                                                        array('id' => 
'pstyle_sel'),
                                                        null);
                                        echo $ajax->divEnd('pstyle_div');
                                ?>
            </td>
        </tr>

And updateInfo() is:

        echo $javascript->codeBlock("
                function updateInfo()
                {
                        if ($('pstyle_sel').length == 0)
                                $('product_style_dsp').hide();
                        else
                                $('product_style_dsp').show();
                }
                                                                ");
        echo $javascript->blockEnd();

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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=.


Reply via email to