All pastes #608986 Raw Edit

hp

public text v1 · immutable
·published 2007-07-08 16:39 UTC
rendered paste body
action:
  public function executeAddComment()
  {
    return "hello by ajax!";
  }

the template that calls the action remotely:

          <div id="add-comment" style="display:none">
            <div id="item_list"></div>
            <h3>Add a comment</h3>
            <?= form_remote_tag(array(
                'update'   => 'item_list',
                'url'      => 'media/addComment?media='.$media->getMediaId(),
                'loading'  => "Element.show('indicator')",
                'complete' => visual_effect('fade', 'indicator', array('duration' => 0.5)), 'class=login-form')) ?>
                <?= textarea_tag('comment','','rows=5 cols=30'); ?>
                <p class="submit"><?= submit_tag('Add comment'); ?> or <?= link_to_function('cancel', visual_effect('toggle_slide', 'add-comment'), array('duration' => 0.5)); ?></p>
            </form>
          </div>