Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1237 2012-09-20 20:24:02

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: zem_contact_reborn 4.0.3.20

heternova, the only thing I could spot is name="Paul Burkhard CD" won’t result in a correct id because of the blanks. Try something like Paul-Burkhard-CD or paul-burkhard-cd and report back.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#1238 2012-09-20 21:07:58

heternova
Member
Registered: 2007-01-26
Posts: 14

Re: zem_contact_reborn 4.0.3.20

hi uli,
thank you. now it works. i dont know if your solution was the one, but thank you!
one last problem: i have to use the same label for every input text. the label is “quantity of cd you want to buy”. at the end the customer receive the email with the quantity but he doesnt know for which CD. Is there a way to add additional information to every input text, something hidden that will complete the label?

thank you

Offline

#1239 2012-09-20 21:34:10

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: zem_contact_reborn 4.0.3.20

You’re welcome. As far as I know is every hidden field (i.e. <txp:zem_contact_secret />) integrated into the email, something you won’t find desireable, whereas the labels only appear for filled in fields. So you’ll have to use the label, I’m afraid. Perhaps like “Quantity of «Paul Burkhard CDs»” if this wording isn’t contradicting local e-commerce laws.

Last edited by uli (2012-09-20 21:46:58)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#1240 2012-09-20 23:39:23

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: zem_contact_reborn 4.0.3.20

Your open-ended “something” in “something hidden” made me hesitate later on: You can of course inject some Javascript into the form. Assuming you’re using a fixed value of 0 in each article amount field, you can easily apply the rah_replace tag, something like:

<txp:rah_replace from='value="0"' to='onblur="CheckValue(this);" value="0"'>
  Some zcr-tag(s) (rah_replace can change several tags at once)
</txp:rah_replace>

and function CheckValue:

<script type="text/javascript">
function CheckValue(field) {
  if (field.value > 0) field.value = "your optional prefix text" + field.value + "your optional suffix text";}
</script>

Or, Javascript-free, but losing accessibility on the form to a certain degree, you hide the labels via CSS and use something like <span class="label">quantity of cd you want to buy</span> and put the desired email text into the zcr label.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#1241 2012-09-21 10:37:11

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: zem_contact_reborn 4.0.3.20

I build a form that validates coupon codes (based on a regex) before submit.
Now I’m trying to record a conversion (google analytics) when form is correctly submitted and record wiche code users had entered.
I tried to use thanks_form but seem that it can’t process txp tag. Is it true?
Someone can suggest me a solution?
Thanks

Offline

#1242 2012-09-21 11:09:00

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: zem_contact_reborn 4.0.3.20

wornout wrote:

I build a form that validates coupon codes (based on a regex) before submit.
Now I’m trying to record a conversion (google analytics) when form is correctly submitted and record wiche code users had entered.
I tried to use thanks_form but seem that it can’t process txp tag. Is it true?
Someone can suggest me a solution?
Thanks

Are you trying to recover the coupon code in the thanks_form?

You won’t be able to do that as the Post variables are cleared before ZCR calls the thanks_form.

One way around this is to add a call to adi_gps at around line 231 in the plugin code, after the email has been sent but before the $_POST array is reinitialised. This will save the Post variables to TXP variables so they are available to the thanks_form.

Offline

#1243 2012-09-24 08:06:44

heternova
Member
Registered: 2007-01-26
Posts: 14

Re: zem_contact_reborn 4.0.3.20

uli wrote:

Your open-ended “something” in “something hidden” made me hesitate later on: You can of course inject some Javascript into the form. Assuming you’re using a fixed value of 0 in each article amount field, you can easily apply the rah_replace tag, something like:

<txp:rah_replace from='value="0"' to='onblur="CheckValue(this);" value="0"'>
  Some zcr-tag(s) (rah_replace can change several tags at once)
</txp:rah_replace>

and function CheckValue:

<script type="text/javascript">
function CheckValue(field) {
  if (field.value > 0) field.value = "your optional prefix text" + field.value + "your optional suffix text";}
</script>

Or, Javascript-free, but losing accessibility on the form to a certain degree, you hide the labels via CSS and use something like <span class="label">quantity of cd you want to buy</span> and put the desired email text into the zcr label.

Uli,
Vielen Dank !

I didn’t see the way to use CSS. It’s the easiest way, and it works great. I just changed some small presentation’s stuff, but now the result is great.
Thank you so much

Last edited by heternova (2012-09-24 08:07:27)

Offline

#1244 2012-09-26 20:54:54

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: zem_contact_reborn 4.0.3.20

I’m having the same issue that hussaihnk had here: http://forum.textpattern.com/viewtopic.php?pid=265395#p265395

I’ve had to remove the <txp:zem_contact_email /> in order to the emails being sent. Can someone please point me how can i edit the plugin in a way that the “from:” is allways the same email (one from my domain)?

Thx in advance

Offline

#1245 2012-09-26 21:35:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: zem_contact_reborn 4.0.3.20

Doesn’t it work if you use the from attribute in the zem_contact tag? It has been a solution for me some time ago.

Offline

#1246 2012-10-17 16:28:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: zem_contact_reborn 4.0.3.20

I am building a form with many fields which will need to be filled multiple times by those who will be using it.

I was wondering if some of the info for some of the fields (namely: name, Surname, Email, telephone, city & country) could be kept in a cookie and refilled automatically. I know about the auto-fill function of most browsers but I cannot count on that as I know that many people who will be filling the form do not have it enabled.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#1247 2012-10-19 01:27:29

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

Re: zem_contact_reborn 4.0.3.20

How long does the information need to be kept? And how often does it need to be updated?

If it’s a lot, then an alternative approach is actually to store it in the database and then recall it. For example, this is the approach I have taken before:

  • create a new table specifically for the data,
  • use mem_simple_form to allow users to enter data, and
  • use smd_query to extract existing data from the table (if it exists) and prepopulate the fields for editing.

The only thing this solution doesn’t do is send an email at the end. If you really need the email, then you could modify mem_simple_form to do so. Otherwise, once the data is in a table then it’s pretty easy to use smd_query to produce reports.

Offline

#1248 2012-10-19 09:25:49

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: zem_contact_reborn 4.0.3.20

colak wrote:

I am building a form with many fields which will need to be filled multiple times by those who will be using it.

I was wondering if some of the info for some of the fields (namely: name, Surname, Email, telephone, city & country) could be kept in a cookie and refilled automatically. I know about the auto-fill function of most browsers but I cannot count on that as I know that many people who will be filling the form do not have it enabled.

This can be achieved with a little editing of ZCR and with the addition of adi_gps.

ZCR clears the POST variables as soon as it has successfully sent the email with the form contents, so you need to save those variables first before the array is wiped. This happens at line 231 in ZCR.

There are two ways of doing this:

1. Insert a call to adi_gps() just before line 231, so replace this:

$_POST = array();

with this:

adi_gps();

$_POST = array();

This will save the POST variables to new Textpattern variables, one for each of the POST variables. You can now use the values of these variables to pre-populate the respective fields in the new form.

2. Insert a new callback into ZCR just before line 231. This enables you to create a new plugin to use this callback to process the captured values in anyway you please before they are wiped. I have used this in the past to submit captured values to a Zoho CRM database in addition to an email being sent.

Replace this:

$_POST = array();

with this:

callback_event('zemcontact.success');

$_POST = array();

You can then add the following line in your plugin code to call the chosen function when the callback event happens:

register_callback('my_function_name','zemcontact.success');

And put the appropriate code to process the POST variables in your function.

Hope this helps.

Offline

Board footer

Powered by FluxBB