Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#565 2009-02-20 17:30:34

vaughn-taylor
Member
From: New Orleans
Registered: 2004-08-06
Posts: 17
Website

Re: zem_contact_reborn 4.0.3.20

I searched through this 57 page thread and didn’t find my answer…

I have a form with 24 checkboxes. When this form is submitted, the resulting email includes the label and answer for all 24 checkboxes even if the checkbox was not checked in the form. So, I have a ridiculous email that with a bunch of “No” answers.

Is there a way to suppress the unchecked checkboxes and only show the “Yes” answers in the email?


Work until your carpal tunnel makes you cry.
—————————-
My “bloggy” TP site >> liberalrevolt.com

Offline

#566 2009-02-22 18:46:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

^^ hack the plugin code. You can do this by editing the plugin code, look for this line:

            zem_contact_store($name, $label, $value ? gTxt('yes') : gTxt('no'));

and replace it with:

            if ($value) zem_contact_store($name, $label, gTxt('yes'));

Offline

#567 2009-02-22 20:44:17

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: zem_contact_reborn 4.0.3.20

I want to output error mesages in different place, so i used to calls of plugin (simplified my code for forum post):

  1. <txp:zem_contact show_input="0" />
  2. <txp:zem_contact show_error="0" />

In #1 i use chh_if_data to output some html when there are errors. but the problem is that even without errors #1 outputs whitespace… And chh_if_data turns true. Tried to look through zem_contact code, but couldn’t find problem part.

Last edited by the_ghost (2009-02-22 20:45:14)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#568 2009-02-22 20:57:06

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

Re: zem_contact_reborn 4.0.3.20

the_ghost wrote:

In #1 i use chh_if_data to output some html when there are errors. but the problem is that even without errors #1 outputs whitespace… And chh_if_data turns true.

Victor, I’ve hit this problem with chh_if_data before. Here’s a modified version, where you can use an ignore=“1” attribute to ignore white space.

function chh_if_data ($atts, $thing='') {
    // Adi: added attribute for ignoring whitespace
    $atts = lAtts(array('debug' => 0,'ignore' => '0'), $atts);

    $f = '/<txp:(\S+)\b(.*)(?:(?<!br )(\/))?'.chr(62).'(?(3)|(.+)<\/txp:\1>)/sU';
    $iftext = EvalElse($thing, true);
    $thresh = 1 + strlen(preg_replace($f, '', $iftext));

    $parsed = parse($iftext);
    // Adi: added trim to ignore whitespace
    if ($atts['ignore']) $parsed = trim($parsed);
    $parsed_len = strlen($parsed);

    $empty = 'Data';
    if (strlen($parsed) < $thresh) { #or !preg_match('/\S/', $parsed)) {
        $parsed = parse(EvalElse($thing, false));
        $empty = 'No Data';
    }
    return $atts['debug']
           ? "<!-- $empty -- Threshhold: $thresh Length: $parsed_len -->" . $parsed
           : $parsed;
}

// Deprecated due to poor naming
function chh_unless_empty ($atts, $thing='') {
    return chh_if_data($atts, $thing);
}
function chh_if_not_empty ($atts, $thing='') {
    return chh_if_data($atts, $thing);
}

Hope it helps.

Cheers,

Adi

Offline

#569 2009-03-03 22:45:25

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: zem_contact_reborn 4.0.3.20

oh dear 57 pages to sift through. if anyone can tell me what page to go to find out how to add something to your navigation bar that’s just: “Newsletter: [email box] submit” ?

<txp:zem_contact to=“user@email.com” to_form=“newsletter” />

“newsletter” form says:

<txp:zem_contact >
<txp:zem_contact_email label=“Newsletter:” /> <txp:zem_contact_submit />
</txp:zem_contact >

but this is all wrong

thanks

Offline

#570 2009-03-08 14:52:00

manncj
Member
From: Buckinghamshire, England
Registered: 2007-10-23
Posts: 48
Website

Re: zem_contact_reborn 4.0.3.20

is there anyway of adding in a remember checkbox to this form to store the data on the webpage?

Offline

#571 2009-03-10 21:02:17

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: zem_contact_reborn 4.0.3.20

Hi,
How can I use java script for the forms value field so that it is display until the user clicks on the text and it then disappears leaving the space to write in the form – does this make sense?

below is what I think I want it to do, but dont know how/where to put the code

<input type="text" id="q" onblur="if(this.value == ''){this.value = 'Search…'}" onfocus="if(this.value == 'Search…'){this.value = ''}" value="Search…" name="q"/>

This is my current contact form (with postmater used)

<txp:zem_contact_text label="Name" break="" name="zemSubscriberName" size="30" default="Name" required="1"/>
<txp:zem_contact_email label="Email Address" default="Email Address" name="zemSubscriberEmail" break="" size="30" required="1"/>
<txp:zem_contact_submit label="Send" />

Many thanks

Last edited by oliverker (2009-03-11 12:25:36)

Offline

#572 2009-03-16 14:55:50

dreamer
Member
Registered: 2007-06-08
Posts: 242

Re: zem_contact_reborn 4.0.3.20

I have this form here; http://rockcreeksprings.com/other/maintenance-request but it won’t submit because it says;” Required field, “Building Address”, is missing.”

The forms been working before but all of a sudden, it doesn’t work now. I can’t figure out why it doesn’t work on the backend. Can someone help? This is how it looks on the backend. I checked the Building address field but dont’ see anything out of the ordinary.

<txp:zem_contact_text label=“Full Name” name=“Name” required=“1” min=“2” /><br />

<txp:zem_contact_email required=“1” /><br />
<txp:zem_contact_text label=“Phone (optional)” min=7 max=15 required=“0” /><br />

<txp:zem_contact_text label=“Building Address” name=“BldngNumber” required=“1” /><br />

<txp:zem_contact_text label=“Unit #” name=“Name” required=“1” min=“2” max=“40” /><br />

<txp:zem_contact_select break=“br” label=“Pets” list=“None, Cat, Dog, Other” /><br />

<txp:zem_contact_select break=“br” label=“What needs fixed?” list=“Bedroom, Bathroom, Kitchen, Dining Room, Living Room, Outdoor Area” /><br />

<txp:zem_contact_textarea label=“Description of maintenance request” cols=“40” rows=“10” /><br />

Check off one of the following;<br />
<txp:zem_contact_checkbox label=“I give permission for maintenance to enter my unit.” required=“0” /><br />
<txp:zem_contact_checkbox label=“Please call to set up time for maintenance to enter my unit” required=“0” /><br />

<txp:zem_contact_submit label=“Submit” />

EDIT: Okay, for some reason, the building address field works but now the full name field doesn’t work. It won’t appear in the email when the form is submitted to my account.

Last edited by dreamer (2009-03-16 15:24:33)

Offline

#573 2009-03-16 16:04:20

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

Re: zem_contact_reborn 4.0.3.20

Clutching at straws here. Note that you use name=“Name” twice, once for the contacters’ name and again for the Unit#.

Offline

#574 2009-03-17 09:24:49

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

Re: zem_contact_reborn 4.0.3.20

Hi everyone. I’ve just released a new plugin – adi_contact – which is designed to be used with zem_contact. It provides:

  • submitted field combination check
  • submitted field content validation
  • anti-spam measures

You’re very welcome to have a play & let me know what you think.

Offline

#575 2009-03-25 23:00:27

everton11
New Member
Registered: 2009-03-25
Posts: 3

Re: zem_contact_reborn 4.0.3.20

I am a first time user of txp and I just did my first site with it. I am having trouble getting this plug-in to work properly. I used the simple tag of <txp:zem_contact to=“mail@mywebsite.com” /> . The form shows up on the page and when I enter a message to test it gives the “thank you” message, but when I check the mailbox to see if it was received….nothing. No message at all. The e-mail address I am using is valid, so I just can’t understand. I don’t know what I’m doing wrong. Any help would be greatly appreciated.

Offline

#576 2009-03-25 23:13:02

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: zem_contact_reborn 4.0.3.20

If the form works fine, you might want to check the mail configuration on the server. I suppose that you have also inspected your spam folder, but oh.. this is not a very likely reason.

Offline

Board footer

Powered by FluxBB