-
Hello, I am creating a group of fields. and there is a callback field, I want to pass a value from another field but under the same group, is there any way to do this?
thank youPosted 1 year ago # -
Hi,
It can be possible with "sanitize" feature: https://codestarframework.com/documentation/#/faq?id=how-to-use-sanitize-
array( 'id' => 'opt-group', 'type' => 'group', 'title' => 'Group', 'sanitize' => 'tuyenvandovn_pass_values', 'fields' => array( ... ... ... ), ),
CopyCopied!function tuyenvandovn_pass_values( $value ) { // uncomment below code and see all values. ( disable ajax save for see all values later you can enable ajax save again ) // var_dump( $value ); exit; $value[2]['title'] = $value[1]['title']; // for eg. it will update "group 1 title field" to "group 2 title field" return $value; }
CopyCopied!Regards, Codestar
Posted 1 year ago # -
it works. thank you
Posted 1 year ago # -
You're welcome
Posted 1 year ago #