1

我想在 Js->submit 中添加 2 个回调,我的第一个返回 true 或 false。继续说我想采取行动。我的意思是如果它是真的,那么它会继续行动,否则在那一刻停止。

我已经尝试过但它没有接受 2 回调。请帮忙。

echo $this->Js->submit("Apply", 
array(
     'id' => 'submitForm', 'div' => false, 'class' => 'general_button', 'style' => array('float:none;', 'margin: 10px;'),
     'url' => array(
                 'controller' => 'categories', 'action' => 'index', 'field' => $search_term, 'value' => $search_value, 'parentId' => $parentId
              ),
     'update' => '#listID', 
     'confirm' => 'Are you sure you want to apply action to selected records ??',
     'before' => $this->Js->event('click', 'return checkboxCount();', false),
     'before' => $this->Js->get('#loaderID')->effect('fadeIn', array('buffer' => false)),
     'complete' => $this->Js->get('#loaderID')->effect('fadeOut', array('buffer' => false)),
     )
);

我将如何继续它。作为函数return checkboxCount();返回真或假。但在这种情况下,我的函数甚至没有被调用。

4

0 回答 0