...
Now in the "verify" event, just add a "db read" and use this in the "conditions" box:
<?php
return array("id" => $form->data("id"), "verified" => 0);
Your table must have a field named "verified", set its type to "TINYINT" with length = 1
Set the "read under model id" in the "db read" to "yes"
and in the "record found" event, add a"custom code" action then a "db save" action.
In the "custom code":
<?php
$form->data["model"]["verified"] = 1;
and in the "db save", set the "save under model id" to "yes" and now it should update the record and set the "verified" field to 1
Max
Thank you for the reply.
I am getting some errors with this still though, I am sure it is my inexperience.
1. I can't get the link to send correctly in the email. When I use {id} in the text, it just gets deleted.
[attachment=0]link.JPG[/attachment]
Do I have this formatted correctly?
http://mysite.com/index.php?option=com_chronoforms5&chronoform=joinform&event=verify&id={id}
2. When I set "Enable model ID" to yes, the data is not getting saved to the database. Here is a screenshot of my mysql. The first line was with model id set to "no." The others are with it set to "yes."
[attachment=1]mysql.JPG[/attachment]
If I enter the above link and type in an id manually, I get this error
[attachment=2]error.JPG[/attachment]
but I don't know how to decipher it.
I am also including a couple other screenshots that I hope may be useful.
This is the layout I have for the form, I have tried placing the data save in either the "on submit" section or the "on verify" or both. Same results.
[attachment=3]layout.JPG[/attachment]
An example debug screen of the initial "on submit"
[attachment=4]debug.JPG[/attachment]
Thank you guys again for being so helpful with this🙂