Hello,
I have tried exhaustedly to access the [var] array in php after I saved data to the db table successfully.
Here is my debug output:
[save_data6] => Array
(
[data] => Array
(
[created] => 2017-08-03 16:17:06
[user_id] => 0
[evdet_id] => 2
[firstname] => te
[lastname] => te
[studentid] => te
[studentemail] => te@te.com
[passcode] => te
[iagree] => ["studenthandbook","vhpolicy","audiovideo","nofooddrink"]
)
[_success] => Data saved successfully
[log] => Array
(
[0] => INSERT INTO `xmugr_student-sign-in` (`created`, `user_id`, `evdet_id`, `firstname`, `lastname`, `studentid`, `studentemail`, `passcode`, `iagree`) values ('2017-08-03 16:17:06', '0', '2', 'te', 'te', 'te', 'te@te.com', 'te', '["studenthandbook","vhpolicy","audiovideo","nofooddrink"]');
)
[var] => Array
(
[created] => 2017-08-03 16:17:06
[user_id] => 0
[evdet_id] => 2
[firstname] => te
[lastname] => te
[studentid] => te
[studentemail] => te@te.com
[passcode] => te
[iagree] => ["studenthandbook","vhpolicy","audiovideo","nofooddrink"]
[aid] => 38
)
)
Any suggestion?
Thanks
I have tried exhaustedly to access the [var] array in php after I saved data to the db table successfully.
Here is my debug output:
[save_data6] => Array
(
[data] => Array
(
[created] => 2017-08-03 16:17:06
[user_id] => 0
[evdet_id] => 2
[firstname] => te
[lastname] => te
[studentid] => te
[studentemail] => te@te.com
[passcode] => te
[iagree] => ["studenthandbook","vhpolicy","audiovideo","nofooddrink"]
)
[_success] => Data saved successfully
[log] => Array
(
[0] => INSERT INTO `xmugr_student-sign-in` (`created`, `user_id`, `evdet_id`, `firstname`, `lastname`, `studentid`, `studentemail`, `passcode`, `iagree`) values ('2017-08-03 16:17:06', '0', '2', 'te', 'te', 'te', 'te@te.com', 'te', '["studenthandbook","vhpolicy","audiovideo","nofooddrink"]');
)
[var] => Array
(
[created] => 2017-08-03 16:17:06
[user_id] => 0
[evdet_id] => 2
[firstname] => te
[lastname] => te
[studentid] => te
[studentemail] => te@te.com
[passcode] => te
[iagree] => ["studenthandbook","vhpolicy","audiovideo","nofooddrink"]
[aid] => 38
)
)
Any suggestion?
Thanks
Hi Learn
{var:save_data6.aid} will return 38
And in PHP:
Both ways are explained in the manual.
Best regards,
Max
{var:save_data6.aid} will return 38
And in PHP:
$this->get("save_data6.aid");
Both ways are explained in the manual.
Best regards,
Max
Hi Max,
Thank you so much for your response. It worked. I am new to this awesome form engine and need to know a little bit about how it works.
Another quick question for you.
I created a form to allow a user to checkin with their passcode. I retrieved the passcode from the db and also read the user code from the field via $this->data['passcode'] and I could verify and return "success" or "fail". How do I intercept to prevent user entry from saving to db if they entered wrong passcode?
Thank you.
Thank you so much for your response. It worked. I am new to this awesome form engine and need to know a little bit about how it works.
Another quick question for you.
I created a form to allow a user to checkin with their passcode. I retrieved the passcode from the db and also read the user code from the field via $this->data['passcode'] and I could verify and return "success" or "fail". How do I intercept to prevent user entry from saving to db if they entered wrong passcode?
Thank you.
Hi Learn,
How do you decide if the passcode is wrong ? if it needs any kind of coding then you will need a PHP action to write the code then return true or false, then use a "Event switcher" and use {var:php_action_name} in the data provider, then set the events list to "true", any actions inside will run if the php returns true.
This is also explained in the tutorial.
Best regards,
Max
How do you decide if the passcode is wrong ? if it needs any kind of coding then you will need a PHP action to write the code then return true or false, then use a "Event switcher" and use {var:php_action_name} in the data provider, then set the events list to "true", any actions inside will run if the php returns true.
This is also explained in the tutorial.
Best regards,
Max
Hi Max,
I just updated my Chronoforms 6 to the latest version and it broke the Display Format of the DateTime type.
I wanted to display like this: 09/25/2017 10:00 AM
What format patterns I should enter into the Display Format box (e.g. DD/MM/YYYY ??:?? AMPM)?
Secondly, when I set Form Settings, AJAX submit to yes, my javascript in the Custom code does not work? Can you please tell the behavior when I use AJAX submit?
Thanks.
I just updated my Chronoforms 6 to the latest version and it broke the Display Format of the DateTime type.
I wanted to display like this: 09/25/2017 10:00 AM
What format patterns I should enter into the Display Format box (e.g. DD/MM/YYYY ??:?? AMPM)?
Secondly, when I set Form Settings, AJAX submit to yes, my javascript in the Custom code does not work? Can you please tell the behavior when I use AJAX submit?
Thanks.
Hi LEarn,
Chronoforms6 is now using the moment JS: https://momentjs.com/
I think that this is format you need to use now:
You can check all the formating strings on the moment website docs
Regarding your code, what do your code do ? please post it here
Best regards,
Max
Chronoforms6 is now using the moment JS: https://momentjs.com/
I think that this is format you need to use now:
DD/MM/YYYY h:mm a
You can check all the formating strings on the moment website docs
Regarding your code, what do your code do ? please post it here
Best regards,
Max
This topic is locked and no more replies can be posted.