Textpattern Forum

You are not logged in. Register | Login | Help

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

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 907
Website

Re: adi_contact – Form field validation & spam prevention

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: Dakar – Sénégal – Africa
Registered: 2008-06-01
Posts: 358
Website

Re: adi_contact – Form field validation & spam prevention

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: Dakar – Sénégal – Africa
Registered: 2008-06-01
Posts: 358
Website

Re: adi_contact – Form field validation & spam prevention

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: Dakar – Sénégal – Africa
Registered: 2008-06-01
Posts: 358
Website

Re: adi_contact – Form field validation & spam prevention

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: 907
Website

Re: adi_contact – Form field validation & spam prevention

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: Dakar – Sénégal – Africa
Registered: 2008-06-01
Posts: 358
Website

Re: adi_contact – Form field validation & spam prevention

Thnks Adi,
I send you a feedback.

Offline

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

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 907
Website

Re: adi_contact – Form field validation & spam prevention

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: Dakar – Sénégal – Africa
Registered: 2008-06-01
Posts: 358
Website

Re: adi_contact – Form field validation & spam prevention

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: 907
Website

Re: adi_contact – Form field validation & spam prevention

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
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,924
Website

Re: adi_contact – Form field validation & spam prevention

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

Board footer

Powered by FluxBB