Forums

Chronoforms5 plugin problem in article

danielitob 09 Mar, 2017
Hi,
i have a strange problem with a form included in k2 article (the same problem appears in joomla article too).

Premise. the same form works to another site with the same templates and the same version of ChronoForms and joomla.

In k2->Item->Impiantistica Sas i set
{chronoforms5}contattiparamoggetto&oggetto=TEST{/chronoforms5}
and i get the variable "oggetto" in my form with code below and it put it in Email-->Dynamic subject: "amp;oggetto"
<?php
$form->data['oggetto'] = $_GET['oggetto'];
?>


The form works if i use Test Form functionality but it does not work in my article.

I have no JS error in my console.
I ' m not able to understand where is the problem.

This is the link:
http://www.condominiosereno.it/elettricista/roma/impiantisticasas

Could you help me?

This is private content


Regards
Daniele
Max_admin 09 Mar, 2017
Hi Daniele,

The js error is not from the form but its from https://connect.facebook.net/it_IT/sdk.js so its related to the facebook module I think.

The form works fine, and there is no field called "oggetto", when you add "&oggetto=test", make sure you are editing the source code of the article, so that the "&" does not get replaced by &

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 10 Mar, 2017
Hi Daniele,

Your custom code won't do anything useful there - the value has to be added to a form element so that it is included with the submitted data. I've replaced it with a hidden input names oggetto - CF automatically gets the value from the URL and sets the value of this input.

That is working OK - but then the submit button does nothing - I'll let you sort that out.

Bob
danielitob 10 Mar, 2017
Hi Bob,
thanks very much for your reply.
I 've used the same form in other site: http://www.dgadvice.com/servizi
At the end of page, if you fill the form with your email you 'll receive an email with subject "[Software Gestionali] Richiesta informazioni". I got this subject with code
<?php
$form->data['oggetto'] = $_GET['oggetto'];
?>

and automatically It has been valued the subject email.

How is it possible?

However, if you suggest me to get variable throught hidden input, can i add a new event (linked to this hidden input) with all the objects that are present in the event on submit ?

Regards
Daniele
danielitob 10 Mar, 2017
Hi Bob,
i think that the problem is in Plugin.

I explain better my opinion.

I've created another k2 article:
Sergio Pippo-test

in my article i set only:
<p>{chronoforms5}contattiparamoggettostatic{/chronoforms5}</p>


then i created a form contattiparamoggettostatic, as you can see in the link below:
http://www.condominiosereno.it/amministratore-condominio/milano/sergio-pippo-test

This form has static subject and , also in this case, the submit form doesn't work.

What do you think about it?

Thanks and Regards
Daniele
GreyHead 10 Mar, 2017
Hi Daniele,

There are two problems with this form

a. You have the form inside <p> tags which is illegal HTML and will prevent it submitting in some versions of IE.

b. The form action URL is an SEF URL and does not work - it is .../amministratore-condominio/milano/sergio-pippo-test?chronoform=contattiparamoggettostatic&event=submit Please see this FAQ

Bob
danielitob 10 Mar, 2017
Hi BOb,
thanks!

a. You have the form inside <p> tags which is illegal HTML and will prevent it submitting in some versions of IE.


done! i remove <p> tag, thanks.


b. The form action URL is an SEF URL and does not work - it is .../amministratore-condominio/milano/sergio-pippo-test?chronoform=contattiparamoggettostatic&event=submit Please see this FAQ



I understand...but in other site i didn't this modify.

I set Relative URL to NO and email works, but if i have i
<input type='hidden' name='oggetto' id='' value='' />
and "oggetto" in Dynamic subject, subject is not present in Email subject, but i have NULL value.

Could you have any suggest?
Regards
Daniele
Max_admin 10 Mar, 2017
Hi Daniele,

Yes, because the oggetto field is empty, you must set a value for it, either a static value, or try to do it using the plugin syntax like before:
{chronoforms5}contattiparamoggetto&oggetto=TEST{/chronoforms5}


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
danielitob 10 Mar, 2017
Hi max,
thanks

i just have {chronoforms5}contattiparamoggetto&oggetto=TEST{/chronoforms5} in my article
Which value i have to set below?

<input type='hidden' name='oggetto' id='' value='' />

regards
Daniele
Max_admin 10 Mar, 2017
Hi Daniele,

So now the "oggetto" hidden field should have the value "TEST" when the form is displayed, please check that ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 10 Mar, 2017
Hi Daniele,

The Sergio Pippo-test article still has the <p> tags around the form
and the form is is calling - contattiparamoggettostatic doesn't seem to have the hidden input so will not submit the value.

Bob
danielitob 11 Mar, 2017
Hi Max, Bob,
thank you for your support.

Maybe I have confused you with my examples. summarize everything with this post, trying to explain better.

I resolved the variable passing from article to Chronoform form setting

Relative URL to NO.


using
{chronoforms5}contattiparamoggetto&oggetto=[Richiesta Informazioni]{/chronoforms5} 

and getting variable using
<input type='hidden' name='oggetto' id='' value='' /> 


When i submit the button
http://www.condominiosereno.it/elettricista/roma/impiantisticasas-test
the form directs me to the page
http://www.condominiosereno.it/component/chronoforms5/?chronoform=contattiparamoggetto&event=submit

with the Display Message that i put in my event "On Submit".

My question is:
Can i redirect to the same page with my "Display Message"?.

If it is not possible, can you suggest my another way to redirect to the same page after submit?

A possible solution would be:
1)Submit button
2)send email to the customer with confirmation message
3)show a pop up in ajax with dislay message

Could you confirm me if i do these 3 step with chronoform?I would opt for this solution only if i can't redirect to the same page after submitting.

Regards
Have a nice day
GreyHead 11 Mar, 2017
HI Daniele,

The simplest way is to use Ajax submission for the form - you can enable that in the HTML (Render form) action; or you can grab the current page URL (there's a FAQ on that) and redirect to it after the form submits.

Bob
danielitob 13 Mar, 2017
Answer
Hi Bob,
thanks a lot. I have used Ajax submission and all works correctly.

Best regards
Daniele
This topic is locked and no more replies can be posted.