Forums

CONVERTER MULTIPLIER DATA TO JSON

atanunu 13 Aug, 2017
Sir, Please how do I convert MULTIPLIER DATA (REPEATER AREA) in a FORM to JSON using CF shortcode and PHP?
GreyHead 13 Aug, 2017
Hi Atanunu,

I think that you can use a Custom Code action something like this:
<?php
$this->data['xxx'] = json_encode($this->data['xxx']);
?>

Bob
atanunu 14 Aug, 2017
I modified the question I asked earlier. Also, Please how do I convert the whole form data to JSON using php?
Max_admin 14 Aug, 2017
Hi Atanunu,

What are you trying to do exactly ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
atanunu 14 Aug, 2017
Thanks Max!

I am trying to:

  • TURN FORM DATA TO JSON

  • TURN DATA FROM REPEATER ACTION / AREA TO JSON


  • Using PHP with the sample code below:

    <?php
    header("Content-Type: application/json; charset=UTF-8");
    
    $returnData = $this->get("repeater_area31"); // Form Data or Repeater area data
    $json = $returnData;
    echo  json_encode($json);
    die;
    ?>
    GreyHead 15 Aug, 2017
    1 Likes
    Hi ataunu,

    One important step is to give your repeater inputs array names like SCHRE[_N_][subject] so that the data is in set of sub-arrays. Please see this FAQ for CFv5.

    Bob
    Max_admin 19 Aug, 2017
    Hi Atanunu,

    form data: $this->data

    And the repeater data should be a subset of the form data.

    Best regards,
    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    This topic is locked and no more replies can be posted.