Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2010-10-27 08:49:58

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

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

Hi Roelof,

Yes, you need to use ZCR in container mode in order to use adi_contact.

Offline

#32 2010-12-29 11:35:58

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

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

Bonjour Adi,

I’ve the same problem as Logoleptic

The form presents the error message regardless of whether the checkbox is checked.

<fieldset id="type-reservation" class="">
	<legend>Type de réservation<br />
		<span class="fieldset-info">My Legend</span>
	</legend>	
	<div><txp:zem_contact_checkbox label="One" name="one" required="0" /></div>
	<div><txp:zem_contact_checkbox label="Two" name="two" required="0" /></div>
</fieldset>
<fieldset id="if_one" class="">
	<legend>IF ONE</legend>	
	<div><txp:zem_contact_text label="Three" name="three" min="1" max="2" default="1" required="0"/></div>
	<div><txp:zem_contact_text label="Four" name="four" required="0" /></div>	
</fieldset>
<fieldset id="if_two" class="">
	<legend>IF TWO</legend>	
	<div><txp:zem_contact_text label="Five" name="five" min="1" max="2" default="1" required="0"/></div>
	<div><txp:zem_contact_text label="Six" name="six" required="0" /></div>	
</fieldset>
<txp:adi_contact_combo names="one,two" checkbox="1" restrict="min" number="1" />
<txp:adi_contact_combo names="one" checkbox="1" require="three,four" />
<txp:adi_contact_combo names="two" checkbox="1" require="five,six" />

Yet I use version 0.3 of your plug’in.
The problem was he able back with textpattern 4.3?

Offline

#33 2010-12-29 12:00:53

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

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

The debug message for <txp:adi_contact_combo names="one,two" checkbox="1" restrict="min" number="1" debug="1" />

DEBUG for adi_contact_combo

SUBMITTED FORM LABEL/VALUE ($zem_contact_form):

array (
  'One' => 'oui',
  'Two' => 'non',
)

SUBMITTED FORM NAME/LABEL ($zem_contact_labels):

array (
  'one' => 'One',
  'two' => 'Two',
)

SUBMITTED FORM NAME/VALUE ($zem_contact_values):

array (
  'one' => 'oui',
  'two' => 'non',
)

ERROR LIST ($zem_contact_error):

array (
  0 => 'At least 1 of “<strong>One, Two</strong>” required.',
)

SUPPLIED ATTRIBUTES:

array (
  'names' => 'one,two',
  'checkbox' => '1',
  'restrict' => 'min',
  'number' => '1',
  'debug' => '1',
)

FIELDS OF INTEREST:

array (
  0 => 'one',
  1 => 'two',
)

SUPPLIED LABELS FROM adi_contact_labels:

array (
)

VERSIONS

adi_contact: 0.3 (active)
zem_contact_reborn: 4.0.3.20 (active)
pap_contact_cleaner: not installed
TXP: 4.3.0
PHP: 5.2.6
MySQL: 5.0.41

LABELS OF INTEREST:

One, Two

VALID FIELD COUNT:

0

MISSING LIST:

{"one":1,"two":1}

Offline

#34 2010-12-29 12:08:30

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

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

SUBMITTED FORM LABEL/VALUE ($zem_contact_form):
array (
  'One' => 'oui',
  'Two' => 'non',
)

oui and non ???

I change the language in English in the textpattern pref and your plug’in works fine. :D
But he does not like other languages.

Offline

#35 2011-01-11 23:02:14

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

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

sacripant wrote:

I change the language in English in the textpattern pref and your plug’in works fine.

Whoops … how very British of me!

I’ve sent you an email with a link to a beta version which should fix this (together with other checkbox problems). Let me know how you get on.

Offline

#36 2011-01-12 11:05:14

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

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

Thnks Adi,
I send you a feedback.

Offline

#37 2011-03-25 00:48:25

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

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

Version 0.4 now available:

  • change: new adi_contact_checkboxes tag (adi_contact_combo ‘checkbox’ attribute withdrawn)
  • enhancement: adi_contact_combo if “value” then “required” (for sacripant)
  • fix: internationalised ‘Yes’ & ‘No’ in checkboxes (thanks sacripant)
  • fix: no more duplicate javascript insertion
  • class action: ‘adi_contact_combo_error’, ‘adi_contact_validate_error’, ‘adi_contact_spam_error’ (for net-carver)
  • new adi_contact_validate type ‘base64’ (for net-carver)
  • javascript code rewrite (& bug fixes: <select>, multiple forms)

An important thing to be concerned with here, is when you upgrade you’ll need to list your checkboxes “of interest” using the <txp:adi_contact_checkboxes /> tag rather than with the checkbox="1" attribute. There’s an unsubtle error message to tell you about this if you don’t! This change will make checkbox validation bullet proof – finally … I hope.

Last edited by gomedia (2011-03-25 00:49:14)

Offline

#38 2011-03-25 15:03:45

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

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

Add conditions with a drop down list (select).

<txp:zem_contact>
  <txp:zem_contact_select name="region" label="Where do you live?"
    list=",UK,France,Germany,Other" />
  <txp:zem_contact_text name="region_other" label="If Other, then where?" required="0" />
  <txp:adi_contact_combo names="region" value="other" require="region_other"
    message="Where else do you live?" />
</txp:zem_contact>

Perfect, a very nice update.
Thanks Adi

Offline

#39 2011-09-06 01:05:13

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

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

Version 0.5 ready for action.

  • fixed: javascript doesn’t find contact <form> if zcr input & error forms are separate (thanks jakob)
  • fixed: error message if no fields filled in when using “value” attribute
  • fixed: errors in checkbox processing (thanks jakob)
  • enhancement: extended “name”+“value” dependency to “restrict” & “number” (for jakob)

Thanks goes to jakob for the comprehensive diagnostics, his patience and the testing of this version.

Offline

#40 2011-09-06 07:24:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,205
Website GitHub

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

enhancement: extended “name”+“value” dependency to “restrict” & “number” (for jakob)

Just for info: this makes it possible to do things like “at least one checkbox” is required.


TXP Builders – finely-crafted code, design and txp

Offline

#41 2012-06-13 13:08:20

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

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

jakob wrote:

bq. enhancement: extended “name”+“value” dependency to “restrict” & “number” (for jakob)

Just for info: this makes it possible to do things like “at least one checkbox” is required.

How would I declare in in the code?

here is what I got:

(...)
<tr>
<td colspan="2"><txp:zem_contact_checkbox group="Campselect" label="Kids Kamp" name="Kids Kamp" required="0"/><span class="early">July 3 - 7 </span><br>
<txp:zem_contact_checkbox group="Campselect" label="Family Camp" name="Family Camp" required="0" /><span class="early">July 14 - 29 </span><br>
<txp:zem_contact_checkbox group="Campselect" label="Young Adult Camp" name="Young Adult Camp" required="0"/><span class="early">Aug 3 - 5</span><br>
<txp:zem_contact_checkbox group="Campselect" label="Youth Camp" name="Youth Camp" required="0"/><span class="early">Aug 6 - 11</span></td>
	</tr>
(...)
<tr>
<td colspan="2">
<txp:zem_contact_submit label="Send" />
<txp:adi_contact_checkboxes names="Kids Kamp,Family Camp,Young Adult Camp,Youth Camp" />
<txp:adi_contact_combo names="Kids Kamp,Family Camp,Young Adult Camp,Youth Camp" require="Kids Kamp,Family Camp,Young Adult Camp,Youth Camp"  restrict="min" number="1" message="Please check at least one camp that interests you" />
</td>
</tr>

not sure That i have it listed right as the form goes through no matter what.

Last edited by pafruu (2012-06-13 13:18:28)


I try, and I try, and I try…. and sometimes I achieve

Offline

#42 2012-06-13 13:21:09

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

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

ok I just tried removing the spaces in the names and it worked


I try, and I try, and I try…. and sometimes I achieve

Offline

#43 2012-09-18 15:39:22

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

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

Is possible to activate validation only if field are filled?

checkbox = “I have a code”
Code = xxx
Code repeat = xxx

Offline

#44 2012-09-19 05:38:48

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

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

wornout wrote:

Is possible to activate validation only if field are filled?

checkbox = “I have a code”
Code = xxx
Code repeat = xxx

Hi Edoardo,

I would hope so … if I’ve understood your scenario above, you’d do something like (off the top of my head):

<txp:adi_contact_combo names="codecheckbox" require="code"  />
<txp:adi_contact_validate names="code,coderepeat" type="equal" />

Offline

#45 2013-12-06 03:58:42

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

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

I’m working on a new version of adi_contact which will insert information supplied in a contact form into a database table. If anyone would like to take it for a beta spin, please let me know.

Adi

Offline

Board footer

Powered by FluxBB