Concrete5 5.7 form block type ajax

Hi! Please help me.
How to enable ajax for form block type?
For sending form without page reload.

View Replies:
hutman replied on at Permalink Reply
This is not an option with the standard form block, you would need to build an external form to do this.
WillemAnchor replied on at Permalink Reply
These snippets for a singlepage i'm working on might get you in the right direction.
* For use in a block you probably have to prefix 'action_' before the response function.

function updateCatActive(id, active) {
         dataType: "json",
         type: "post",
         data: {
            pk:   id,
            name: 'Active',
            value: active
         url:   "<?php echo $view->action('update_cat_field')?>",
         success: function(response) {


public function update_cat_field() {
      $ret = array('success' => false, 'message' => t("Error"));
      if ($this->isPost()) {
         $catID = $this->post('pk');
         $catField = trim($this->post('name'));
         $catValue = trim($this->post('value'));
         if (($catID > 0) && is_string($catField) ){
            $ret['success'] = true;
// do some magic
         } else $ret['message'] = t('Error' . $catID . $catField . $catValue);
      } else $ret['message'] = t('Error, no parameters');
      echo Core::make('helper/json')->encode($ret);

Don't forget the exit.
WillemAnchor replied on at Permalink Reply