Forums

Create a form that lists the data input

marcokraan 04 Mar, 2016
Hello I need some help to create a form:

I want to create a form who gives the visitor the opportunity to subscribe for an event. This person enters the data that's being questioned. After he clicks the button submit the form have to generate a email to a specific emailadres and the form must save en list the data in a second page so one knows who en how many subscribers will visit the specific event.

Who can help?

Grtz, Marco
GreyHead 05 Mar, 2016
Hi Marco,

You could either:

a. redirect the user to a ChronoConnectivity listing to show the participants; or

b. use a DB Read action to get the data, then use PHP in a Custom Code element to display it as a table. The PHP would just loop through the results from the DB creating a table row for each entry.

Bob
marcokraan 05 Mar, 2016
Hello Bob

I'm not a programmer... So with PHP I will need som help🙂

Marco
marcokraan 05 Mar, 2016
Bob

I watched the video to save data to the DB. Followed it and I can select the db in the management-administrator environment but the data of my form won't save in the DB.
Can't figure out what I'm doing wrong....
marcokraan 05 Mar, 2016
Al saved now. But how do I get the code set to echo the list?
GreyHead 06 Mar, 2016
HI Marco,

Please drag a Debugger action into the form after the DB Read action, then load the form and post the debug results here.

Bob
marcokraan 07 Mar, 2016
Array
(
    [option] => com_chronoforms5
    [chronoform] => vrijwilligersfeest_captcha
    [event] => submit
    [name] => Test
    [phone] => 0123456789
    [email] => My@youremail.com
    [radio7] => 0
    [captcha] => 
    [submit6] => Submit
    [id] => 3
    [ip_address] => 86.93.63.134
    [Data9] => Array
        (
            [Name] => test
        )

)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
    [8] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `jrw32_cf_vrijwilligersfeest` (`name`, `phone`, `email`, `radio7`, `user_id`, `uniq_id`, `created`) values ('Test', '0123456789', 'My@youremail.com', '0', '0', 'f17d4ef1e9ce3d8ac6883706e5108f0e3783cbaf', '2016-03-07 19:28:35');
                        )

                )

        )

    [1] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:m.kraan@sport_domain.com
                    [2] => Subject:Aanmelding vrijwilligersfeest 2016
                    [3] => From name:www.sport_domain.com
                    [4] => From email:noreply@sport_domain.com
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<div class="gform-all"><table class="gform-section"><tr class="gform-line-tr" id="ftr-name"><td class="gform-line-td" id="ftd-name"><label for="name" class="gform-label-left">Name</label>
<div class="gform-input-container gform-input" id="fin-name">Test</div></td></tr><tr class="gform-line-tr" id="ftr-email"><td class="gform-line-td" id="ftd-email"><label for="email" class="gform-label-left">Email</label>
<div class="gform-input-container gform-input" id="fin-email">My@youremail.com</div></td></tr><tr class="gform-line-tr" id="ftr-phone"><td class="gform-line-td" id="ftd-phone"><label for="phone" class="gform-label-left">Phone</label>
<div class="gform-input-container gform-input" id="fin-phone">0123456789</div></td></tr><tr class="gform-line-tr" id="ftr-message"><td class="gform-line-td" id="ftd-message"><label for="message" class="gform-label-left">Message</label>
<div class="gform-input-container gform-input" id="fin-message"></div></td></tr><tr class="gform-line-tr" id="ftr23"><td class="gform-line-td" id="ftd22"><label for="fld16" class="gform-label-left">Enter the code</label>
<div class="gform-input-container gform-input" id="fin21">
<div class="gform-input-container gform-subinput-container-wide" id="fitem18"></div>

<div class="gform-input-container gform-subinput-container-wide" id="fitem20"></div></div></td></tr><tr class="gform-line-tr" id="ftr-submit6"><td class="gform-line-td" id="ftd-submit6">
<div class="gform-input-container gform-input" id="fin-submit6"></div></td></tr></table></div><br /><br />IP: 86.93.63.134
                )

        )

    [3] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:My@youremail.com
                    [2] => Subject:Dank voor je aanmelding voor het vrijwilligersfeest!
                    [3] => From name:Sportclub Silvolde
                    [4] => From email:noreply@sport_domain.com
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<div class="gform-all"><table class="gform-section"><tr class="gform-line-tr" id="ftr-name"><td class="gform-line-td" id="ftd-name"><label for="name" class="gform-label-left">Name</label>
<div class="gform-input-container gform-input" id="fin-name">Test</div></td></tr><tr class="gform-line-tr" id="ftr-email"><td class="gform-line-td" id="ftd-email"><label for="email" class="gform-label-left">Email</label>
<div class="gform-input-container gform-input" id="fin-email">My@youremail.com</div></td></tr><tr class="gform-line-tr" id="ftr-phone"><td class="gform-line-td" id="ftd-phone"><label for="phone" class="gform-label-left">Phone</label>
<div class="gform-input-container gform-input" id="fin-phone">0123456789</div></td></tr><tr class="gform-line-tr" id="ftr-message"><td class="gform-line-td" id="ftd-message"><label for="message" class="gform-label-left">Message</label>
<div class="gform-input-container gform-input" id="fin-message"></div></td></tr><tr class="gform-line-tr" id="ftr23"><td class="gform-line-td" id="ftd22"><label for="fld16" class="gform-label-left">Enter the code</label>
<div class="gform-input-container gform-input" id="fin21">
<div class="gform-input-container gform-subinput-container-wide" id="fitem18"></div>

<div class="gform-input-container gform-subinput-container-wide" id="fitem20"></div></div></td></tr><tr class="gform-line-tr" id="ftr-submit6"><td class="gform-line-td" id="ftd-submit6">
<div class="gform-input-container gform-input" id="fin-submit6"></div></td></tr></table></div><br /><br />IP: 86.93.63.134
                )

        )

    [9] => Array
        (
            [DB Read] => Array
                (
                    [Queries] => Array
                        (
                            [0] => SELECT `Data9`.`Name` AS `Data9.Name` FROM `jrw32_cf_vrijwilligersfeest` AS `Data9`
                        )

                )

        )

)
marcokraan 07 Mar, 2016
Bob, would you please remove the URL's en email addresses in this item please? Thank you!
GreyHead 08 Mar, 2016
Hi Marco,

It looks like you only have one value in result of the DB Read action?
  [Data9] => Array
        (
            [Name] => test
        )
This code will display it
<?php
echo '<table>';
foreach ( $form->data['Data9'] as $v ) {
  echo "<tr><td>{$v}</td></tr>";
}
echo '</table>';
?>

Bob
This topic is locked and no more replies can be posted.