Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#397 2008-08-22 18:06:15
Re: zem_contact_reborn 4.0.3.20
alexandra wrote:
On frontpage are two links pointing to the ZCR form. Now when you hit link A checkbox A should be checked. When you hit link B checkbox B should be checked an A unchecked.
Hi alexandra,
you could probably achieve what you want using one of this plugins: chs_if_urlvar, or smd_if plugin.
Both can be used for the same solution: passing a variable through the URL (that is, on your frontpage links), and then execute some conditional code inside your zem_contact form.
Like this (pseudo code):
if url var = A value = 1
zem_contact_checkbox name="A" checked="1"
zem_contact_checkbox name="B" checked="0"
if url var = B value = 1
zem_contact_checkbox name="A" checked="0"
zem_contact_checkbox name="B" checked="1"
Offline
#398 2008-08-23 02:16:04
Re: zem_contact_reborn 4.0.3.20
uli wrote:
For #1: have a look at the DOM of any Google search form (extract here) or, if you prefer jQuery, see Bloke’s reply below.
Thanks for that Uli.
The main next challenge for me as a none coder was the fact that <txp:zem_contact />
doesn’t have a “name” attribute, so targeting the form does not seem possible without hacking the plugin.
After trial and error, I found that I could add name="zemContactForm"
just after class="zemContactForm"
round about line 286.
Rudd, I hope that’s okay?
Offline
#399 2008-08-23 09:49:40
Re: zem_contact_reborn 4.0.3.20
Sure, that’ll work fine as long as you have only one form on the page.
Offline
#400 2008-08-23 22:46:57
Re: zem_contact_reborn 4.0.3.20
Thanks Rudd.
Out of curiosity, why doesn’t the form have a “name” attribute?
Offline
#401 2008-08-24 08:44:33
Re: zem_contact_reborn 4.0.3.20
No specific reason. As I understand it you can reference forms by name, but also by number.
Offline
#402 2008-08-25 01:11:29
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: zem_contact_reborn 4.0.3.20
possible to augment zem_contact_reborn functionality to allow user to upload up to 5 images along with the response form?
or is a different solution a better path to follow?
(I saw a plugin that offered file uploads but doesn’t appear to be available any more.)
Offline
#403 2008-08-25 06:17:39
Re: zem_contact_reborn 4.0.3.20
nardo wrote:
(I saw a plugin that offered file uploads but doesn’t appear to be available any more.)
Hi nardo. Anonymous File Upload is available on request
Last edited by colak (2008-08-25 06:18:22)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#404 2008-08-28 00:48:30
- weber
- New Member
- Registered: 2008-06-08
- Posts: 8
Re: zem_contact_reborn 4.0.3.20
Hi all!
I’d like to use a custom field containing an email address to define the “to” attribute for zem_contact_reborn, something like:
<txp:zem_contact to='<txp:custom_field name="Email" />' subject="Enquiry from web site" label="">
Even after searching the forum and reading the info on TXP’s tag parsing , it still doesn’t seem to work, so I tried something based on something I’ve seen Mary and Ruud do before, like:
<txp:php>
global $zem_contact_form;
echo zem_contact(array('to'=> custom_field(array('name' => 'email')), 'subject'=>'Enquiry from web site', 'label'=>'' ));
</txp:php>
I’m not a PHP coder, and the above is so obviously wrong, but you may perhaps get an idea of what I was trying to do.
Is anyone able to give me some tips?
Offline
#405 2008-08-28 05:13:36
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: zem_contact_reborn 4.0.3.20
weber wrote:
Is anyone able to give me some tips?
Hello weber. Not sure if I can help much but here are a few things…
- You are running on the latest svn version of Txp right?
- You have different capitalizations for the ‘Email’ / ‘email’ string in your examples. What is your custom field actually called?
— Steve
Offline
#406 2008-08-28 05:55:48
- weber
- New Member
- Registered: 2008-06-08
- Posts: 8
Re: zem_contact_reborn 4.0.3.20
Hi Steve! Thanks for your help – you’re a cornerstone of the TXP community. =)
Running on TXP version: 4.0.6 (r2805).
Custom field is actually ‘Email’ (capitalised).
Cheers.
Offline
#407 2008-08-28 06:54:34
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: zem_contact_reborn 4.0.3.20
weber
AFAIK, the parser re-write didn’t go in the code till r2860 — so it’s no wonder your first example (with the correct field name) isn’t working! The second example is probably failing due to the wrong capitalization (but I’ve not tried it).
Try updating your files from svn and giving the first one another chance.
— Steve
Offline
#408 2008-08-28 11:01:19
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: zem_contact_reborn 4.0.3.20
Probably less work (and risks) to apply asy_wondertag.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline