Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2009-05-14 09:45:32
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_contact – Form field validation, spam prevention & more
joebaich wrote:
Adi, Very many thanks, how could I be so blind to that!
That’s OK. It happens to me all the time. It was only when I blindly pasted your code into my test bed that the helpful Textpattern provided the answer!
Offline
Re: adi_contact – Form field validation, spam prevention & more
Adi,
You know, in this case, the profound annoyance I felt with myself for missing the names vs name error was surpassed by the absolute delight I experienced when the form began to behave as it should. It is a mini poll aimed at members of an Institute and needed to include verification that the respondent is a bone fide member. The error checking and verification that your plug-in provides makes it straightforward to do with ZCR. Very many thanks again.
Joe
Offline
#18 2009-06-17 02:48:46
- kevinpotts
- Member

- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: adi_contact – Form field validation, spam prevention & more
Adi, this is another amazing plugin. I read through the documentation, and I have a quick question. Can you determine if two fields are the same value? For instance, in a contact form, having a field for an e-mail address, and then a second field to type in the e-mail address again, and then somehow verifying they’re the same value?
Kevin
(graphicpush)
Offline
#19 2009-06-17 03:45:49
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_contact – Form field validation, spam prevention & more
Hi Kevin.
kevinpotts wrote:
Can you determine if two fields are the same value?
Sounds feasible – I’ll look into it.
Offline
Re: adi_contact – Form field validation, spam prevention & more
hello, seams to me that some break; are missing in adi_contact_validate :
case 'phone':
$ok &= preg_match("/^[0-9x\ \+\-\(\)\.,]*$/i",$field_value);
case 'url':
$ok &= preg_match("/^(?:http:\/\/)?(?:[\w-]+\.)+[a-z]{2,6}$/i",$field_value);
case 'custom':
if ($pattern)
$ok &= preg_match($pattern,$field_value);
Took some time to figure out.
regards
Last edited by planeth (2009-06-19 10:32:52)
Offline
#21 2009-06-19 10:39:54
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_contact – Form field validation, spam prevention & more
planeth wrote:
hello, seams to me that some break; are missing in adi_contact_validate :
You’re quite right! Thanks for pointing out my not-so-deliberate mistake. Strangely enough, I spotted it last night when looking into Kevin Potts’ request. It’ll be fixed in the next update.
Offline
Re: adi_contact – Form field validation, spam prevention & more
You’re welcome !
I’ll check for updates.
Offline
#23 2010-05-27 18:22:12
- Logoleptic
- Plugin Author

- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: adi_contact – Form field validation, spam prevention & more
This looks like a very useful plugin, but unfortunately I’ve had trouble getting it to work. There seems to be a problem with this plugin’s conditional field requirement feature in cases where one of the fields is a checkbox and the other is not.
The form I’m working on has a checkbox where the user indicates their preference for getting a sales call. If they check the box, a bit of JavaScript reveals and enables the phone number field. I want the phone number field to be required only if the user checked the box indicating that calls are okay. Here’s the code I’m using for that part of the form:
<ul id="phone-fields">
<li><txp:zem_contact_checkbox name="prospect-phonepref" label="I want a sales associate to call me." required="0" break="" /></li>
<li id="optional-phone"><txp:zem_contact_text name="prospect-phonenum" label="Phone Number" required="0" min="7" max="30" break="" /></li>
</ul>
<txp:zem_contact_submit>Request Free Trial</txp:zem_contact_submit>
<txp:adi_contact_combo names="prospect-phonepref" checkbox="1" require="prospect-phonenum" message="If you want us to call you, please provide your phone number." />
The form presents the error message regardless of whether the checkbox is checked. Unless I’ve misunderstood the plugin’s documentation, this should work… right?
Offline
#24 2010-05-27 23:19:07
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_contact – Form field validation, spam prevention & more
Logoleptic wrote:
… There seems to be a problem with this plugin’s conditional field requirement feature in cases where one of the fields is a checkbox and the other is not.
Hi Adam, I’ll look into it.
Offline
#25 2010-05-28 00:57:54
- Logoleptic
- Plugin Author

- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: adi_contact – Form field validation, spam prevention & more
Thanks. :)
Offline
#26 2010-06-02 02:52:13
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_contact – Form field validation, spam prevention & more
Version 0.3 available for download:
- enhancement: new adi_contact_validate option – type=“equal” (for Kevin Potts)
- fix: adi_contact_combo now processes an unticked checkbox correctly (as not being a field of interest) (thanks Logoleptic)
- fix: adi_contact_validate coding error (thanks planeth)
Usual terms & conditions apply.
Offline
#27 2010-07-25 21:59:33
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: adi_contact – Form field validation, spam prevention & more
Adi
Salutations from the UK and thanks for this plugin. Looks good. I’m using it for the first time on a site now. Could you let me know if the adi_contact_spam tag changes the class of any spam-laden form item too?
— Steve
Offline
#28 2010-07-25 22:55:51
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_contact – Form field validation, spam prevention & more
net-carver wrote:
Salutations from the UK and thanks for this plugin. Looks good. I’m using it for the first time on a site now. Could you let me know if the
adi_contact_spamtag changes the class of any spam-laden form item too?
Greetings. The short answer is “no it doesn’t”, the long answer is “it probably should, so let me look into it”.
Offline
#29 2010-07-25 22:59:35
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: adi_contact – Form field validation, spam prevention & more
gomedia wrote:
Greetings. The short answer is “no it doesn’t”, the long answer is “it probably should, so let me look into it”.
Those are both great answers. I thought I was doing something wrong — thanks Adi.
— Steve
Offline
#30 2010-10-27 06:34:44
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: adi_contact – Form field validation, spam prevention & more
Hello,
I want to use your plugin but instead fof a container I use this : <txp:zem_contact to=“postmaster@tamarawobben.nl” thanks_form=“thanks” />
Must I know made a container of can I work this way ?
Roelof
Offline