I'm working with ChronoForms5 and ChronoConnectivity5 and I can not solve a problem (maybe it will be stupid and I do not even see it). With a form, customers send me data. Besides their address they can send me another address for shipping. With the conditional system you open the "shipping address" form, if the customer selects "No" ok, in case of "Si" the mask does not open. (
So far everything is ok. The form arrives via email quietly and works well. Now I've connected ChronoConnectivity5 and I'm compiling the code to "edit" the data.
In "Admin List" / "Actions" / "Edit" ----
Code I entered the following:
But by checking the conditional does not work.
<?php if ($form->data['spedizione'] == "Si"): ?><table width="80%" border="1" style="border-collapse: collapse;"><tr><td colspan="2" align="center"><b><font style="color:red;">L'indirizzo di spedizione è lo stesso</font></b></td></tr></table><?php else: ?><table width="80%" border="1" style="border-collapse: collapse;"><tr><td colspan="2" align="center"><b><font style="color:red;">L'indirizzo di spedizione è:</font></b></td></tr><tr><td><b>Nome e Cognome:</b> {nomesp} {cognomesp}</td><td><b>Ind.:</b> {indirizzosp}, {civicosp}</td></tr>....</table><?php endif ?>
Where am I wrong?
Thank you.
can I use CCv6 with CF5?
With CCv6 I can perform the operation conditional that in CCv5 drives me crazy?
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" /><br />
And there are FAQs and demo connections. The problem isn't lack of documentation so much, it's that it's complicated.
OK well when you said at the start that "the conditional does not work" what do you mean? What IS shown, and what is supposed to show instead?
In "Admin List - Actions - Edit" I open the edit window (cattura001) and up to here everything is fine. When I report the data there is a conditional question that comes from CFv5 "Cattura spedizione uguale?" and the data, as you can see, arrives exactly.
If the answer, if "No" should appear the window you see in capture002, otherwise the window does not appear.
I was thinking of solving with
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" /><br />But this does not work. I am convinced that this is a stupid mistake ... and yet I do it! :-(
<br />
<?php
if ($Calessini.spedizione == "Si"):
?>
<table width="50%" border="1" style="border-collapse: collapse;">
<tr>
<td colspan="2" align="center"><b><font style="color:red;">L'indirizzo di spedizione è lo stesso</font></b>
</td></tr>
</table>
<?php else: ?>
<table width="50%" border="1" style="border-collapse: collapse;">
<tr>
<td colspan="2" align="center"><b><font style="color:red;">L'indirizzo di spedizione è:</font></b>
</td></tr>
<tr>
<td width="50%"><b>Nome e Cognome:</b> {Calessini.nomesp} {Calessini.cognomesp}</td>
<td width="50%"><b>Ind.:</b> {Calessini.indirizzosp}, {Calessini.civicosp}</td></tr>
<tr><td width="50%"><b>Cap: </b> {Calessini.capsp}</td>
<td width="50%"><b>Città:</b> {Calessini.cittasp}</td></tr>
<tr><td width="50%"><b>Prov.:</b> {Calessini.provinciasp}</td>
<td width="50%"><b>Telefono:</b> {Calessini.telefonosp}</td></tr>
<tr>
<td width="50%"><b>Email:</b> {Calessini.emailsp}</td><td></td></tr>
</table>
<?php endif ?>
Thanks for your patience
if ($Calessini.spedizione)
Also, just before that conditional, can you echo the value of $Calessini.spedizione to make sure it has the value you're expecting it to?
<label> Indirizzo spedizione uguale? </ label> <input type = "text" class = "input-mini" style = "font-weight: bold" name = "Calessini [spedizione]" /> <br />[/pre]
Then the conditional:
<?php if ($Calessini.spedizione == 0): ?>should work ...
Today I try and let you know.[br]Thanks for now.
0 equates to false, 1 equates to true. So
<?php if ($Calessini.spedizione): ?>Is the same as
<?php if ($Calessini.spedizione == true): ?>
is the same as
<?php if ($Calessini.spedizione == '1'): ?>
So on and so forth.
http://php.net/manual/en/types.comparisons.php
begin to have a doubt.
When I recall the data with:
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" /><br />the data is reported as "0" or "1"
When I insert it between the <? Php tags it does not work.
Can this be the problem?
<?php if ($Calessini[spedizione] == '1'): ?>
$ form-> data ["field"]
it is not the same as:
$ form->Calessini ["spedizione"] =
$ form-> ModelTitle["field"]
form is the name of the form in CFv5 ??? or... 😶
<?php echo $form->Calessini["spedizione"]; ?>but no result...
if I avoid the Php ... it works
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" /><br />
"Calessini[spedizione]"
<input type = "text" name = "Calessini[spedizione]" />
appears in HTML but not in PHP ...
The format is the last one that healyhatman posted
<?php echo $form->data['Calessini']['spedizione']; ?>Adding a debugger action will show you the names and values of the form data.
Bob
I tried
<?php echo $form->data['Calessini']['spedizione']; ?>but I did not have any answer.
Not having complete knowledge of CCv5, could you tell me where to insert the debugger action?
Thank you
Just to be clear is this ChronoForms v5 or ChronoConnectivity v5? There isn't normally form data in CC.
In CCv5 there is a Display Debug option near the bottom of the Front List > Settings tab.
Bob
summary the work:
1) I have prepared the form in ChronoForms5 and it works perfectly. the form arrives both to me and in copy to the client.
2) always in CFv5 I created the table (amod_calessini) that records every form sent.
3) With ChronoConnectivity5 I interrupt the table (amod_calessini) and all the data are reported.
At the moment I'm working in "Admin List" -> action -> Edit;
I created a linkable voice that gives me the opportunity to see all the details of that Id and possibly modify it.
The problem arises when I have to perform conditional If / then:
If shipping address is Equal then "same address"
"else" "the shipping address is:" etc.
If I report in the CC5 the result of the radiobox in CF5 this is reported quietly
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" /><br />
By entering in PHP
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" /><br />Warning, the code after else is the result of attempts so it can be wrong
<?php if ($form->data['Calessini']['spedizione'] == '1'): ?>
<table width="50%" border="1" style="border-collapse: collapse;">
<tr>
<td colspan="2" align="center"><b><font style="color:red;">L'indirizzo di spedizione è lo stesso</font></b>
</td></tr>
</table>
<?php else: ?>
<table width="50%" border="1" style="border-collapse: collapse;">
<tr>
<td colspan="2" align="center"><b><font style="color:red;">L'indirizzo di spedizione è:</font></b>
</td></tr>
<tr>
<td width="50%"><b>Nome e Cognome:</b> {Calessini.nomesp} {Calessini.cognomesp}</td>
<td width="50%"><b>Ind.:</b> {Calessini.indirizzosp}, {Calessini.civicosp}</td></tr>
<tr><td width="50%"><b>Cap: </b> {Calessini.capsp}</td>
<td width="50%"><b>Città:</b> {Calessini.cittasp}</td></tr>
<tr><td width="50%"><b>Prov.:</b> {Calessini.provinciasp}</td>
<td width="50%"><b>Telefono:</b> {Calessini.telefonosp}</td></tr>
<tr>
<td width="50%"><b>Email:</b> {Calessini.emailsp}</td><td></td></tr>
</table>
<?php endif ?>
I take your advice, it's right to work on a current product. The point, as I told you in another post is that I have always worked with 5, the form is already online and works. I wanted to complete the project with 5 and then devote myself more calmly to learning the 6 .... that's all.
sorry but I had forgotten the debugger from this result

the data arrives but is not processed in Php
I did not explain that with CC I manage all the forms that arrive.
in these forms it is expected to insert a different address of the sender for the shipment. If this other address does not exist, I would like the corresponding fields not to appear. That's why I would like to get this result also in CC with Php (if then) and the given calessini.spedizione coming from the form.
I hope I have been clear and thank you for your patience
But whatever. Let's keep trying.
Where are you putting this PHP code? Have you tried putting it in "PHP functions", as something along the lines of
model.field:if($row['model']['field'] == 1) return "HTML THAT I WANT"; else return "SOME OTHER HTML CODE";
<label> Indirizzo spedizione uguale?</label><input type="text" class="input-mini" style="font-weight: bold" name="Calessini[spedizione]" />The result of the variable will be returned
"Calessini[spedizione]"
Why if I insert the request among the php tags the same is not returned?
<?php echo $Calessini[spedizione];?>
Where are you putting this code?
I finally solved thanks to the syntax you gave me.
The error was in comparing If with "Yes" instead of with 1 or 0.
Unfortunately, when you do not have a good preparation like me and little time to study you make ugly figures like I did. ...
Thanks and see you soon .... 🤗😶
