Hi Group :)

This code was working perfectly fine in Cake 1.2x :

<?php echo $this->Html->scriptBlock("function showTab(name) {
    var f = $$('div#content .tab-content');
        for(var i=0; i<f.length; i++){
                Element.hide(f[i]);
        }
    var f = $$('div.tabs a');
        for(var i=0; i<f.length; i++){
                Element.removeClassName(f[i], 'selected');
        }
        Element.show('tab-content-' + name);
        Element.addClassName('tab-' + name, 'selected');
        return false;
}");
?>
<?php foreach($tabs as $tab): ?>
<?php $selected = ($selected_tab == $tab['name']) ? "selected" : ""; ?
>
    <li><?php echo $html->link($tab['label'],aa('tab',$tab['name']),
                                     aa('id', "tab-".$tab['name'],
                                     'class',$selected,
                                     'onclick',
"showTab('{$tab['name']}'); this.blur(); return false;",
                                     'escape', false
                                     )) ?></li>
<?php endforeach; ?>

Now it doesn't.

If I remove the showTab bit from the onclick event, it returns false,
otherwise it just ignores it.

Any tips?

I know I could use jQuery tabs, but I prefer to use the above code for
layout consistency.
I looked into the Js helper, but I couldn't produce any working code.

Jacob

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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=en

Reply via email to