Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2009-04-19 19:54:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,826
Website

Re: adi_contact – Form field validation, spam prevention & more

Rockin! Thanks for the new stuff, Adi. Running on my site without a hitch.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2009-04-20 21:41:00

valpc
Member
Registered: 2007-03-01
Posts: 18

Re: adi_contact – Form field validation, spam prevention & more

Thank Adi, that’s great.

Offline

#13 2009-05-13 21:07:36

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: adi_contact – Form field validation, spam prevention & more

This is a great plug-in. It really does extend the use of zemcr.

I am struggling with some check boxes though. The snippet below is intended to ensure that the user completes at least one checkbox indicating an interest in a particular qualification or qualifications. The error message appears whether 0, 1, 2 or all 3 boxes are checked. I am using version 0.2.

<div><txp:zem_contact_checkbox label="CEng" name="ceng" break="" required="0" /></div>
<div><txp:zem_contact_checkbox label="IEng" name="ieng" break="" required="0" /></div>
<div><txp:zem_contact_checkbox label="EngTech" name="engtech" break="" required="0" /></div>
<txp:adi_contact_combo name="ceng,ieng,engtech" checkbox="1" restrict="min" number="1" message="Please check at least one Professional Registration that interests you" />

Any idea where I am messing up?

Joe

Offline

#14 2009-05-14 00:23:27

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,226
Website

Re: adi_contact – Form field validation, spam prevention & more

joebaich wrote:

This is a great plug-in. It really does extend the use of zemcr.

Glad you find it useful.

I am struggling with some check boxes though. Any idea where I am messing up?

Try using names= rather than name=.

Cheers,

Adi

Last edited by gomedia (2009-05-14 00:24:26)

Offline

#15 2009-05-14 02:59:17

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: adi_contact – Form field validation, spam prevention & more

gomedia wrote:

Try using names= rather than name=.

Adi, Very many thanks, how could I be so blind to that!

Offline

#16 2009-05-14 09:45:32

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,226
Website

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

#17 2009-05-14 13:09:31

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

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: Kansas City
Registered: 2004-12-07
Posts: 364
Website

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?

Offline

#19 2009-06-17 03:45:49

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,226
Website

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

#20 2009-06-19 10:29:03

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 196
Website

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

Board footer

Powered by FluxBB