AnsweredAssumed Answered

How to get the value of non-db field in logic hook without manual change?

Question asked by Maria Georgieva on Mar 7, 2014
Latest reply on Mar 9, 2014 by Chris Raffle
Currently working with v7.1.5
I have created a custom field type that is a copy from textarea but without the more/less functionality.
It contains various input fields with dynamically generated number of rows. I have attached onchange/click/etc events to them that run a function that collects all the data from them in an array. The array is then encoded to a string and set as the value of the main textarea field, which I want to decode back in a logic hook (before save).

The problem is that unless I manually do changes to the textarea field no value is passed to the logic hook. I want that field hidden so I tried to trigger the change event through code  - $(my-nondb-field).trigger('change');
The value is now saved but calling this event causes a re-render of the field which really messes up the functionality.

The question - Is there a way to send the field value to the logic hook without calling the change event or is there a way to call the event but not cause a re-render of the field?

Outcomes