Dynamic javascript action Apply simple math functions to calculate fields using js (Added in version 4.5)

You can apply simple math functions to calculate fields using javascript. For example, if you want to get sum of two or more fields, or get sum of field with multiplication.

In the below example, we are getting sum of three fields and substracting one field on change event. If you don't specify the $eventFields argument then it will automatically apply change event on each of the formula fields so it will calculate on the change on the all these four fields.

                $pdocrud = new PDOCrud();

                 * Set/Call js actions for the form elements on some js event
                 * @param   string   $element                     Main element, On which element, calculated value should be displayed

                 * @param   string   $formula                     Formula to be applied
                 * @param   string   $event                       Javascript event, this will be applied on formula fields  if no event fields passed
                 * @param   string   $eventFields                 Event fields if any
                 * return   object                                Object of class
                $pdocrud->setJsActions("order_total", "{order_sub_total} + {tax} + {shipping} - {discount}","change");

                echo $pdocrud->dbTable("x_ordertable")->render("insertform");
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pdocrud7_pdocrud.x_ordertable' doesn't exist