Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#556 2009-02-06 17:56:27

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

The elements of the form have to be known server side. You can hide certain fields based on a client-side action, but not remove them.

Offline

#557 2009-02-10 16:39:53

simoin
Member
From: Ireland
Registered: 2009-02-10
Posts: 50
Website

Re: zem_contact_reborn 4.0.3.20

Has anybody included a datepicker or calendar feature with zem contact reborn, I have a contact form that I need to include either a calendar datepicker or a select menu with the current date present.

[Update]

Thanks to visualpeople and Logoleptic, ( see below) I’m going to try Logoleptic’s idea,
as the client is wants the current year and future dates in the select menu,

I’ll report back if I can get it working, thanks for the headstart.

Simon

Last edited by simoin (2009-02-12 14:07:38)

Offline

#558 2009-02-10 17:50:32

visualpeople
Member
From: Corvallis, Oregon - USA
Registered: 2005-11-16
Posts: 73
Website

Re: zem_contact_reborn 4.0.3.20

I’ve never gone so far as to set up a date picker, but we have a site where we need people to tell us when their potential event will be held, we just use this code:

<txp:zem_contact_select label="Date: " list="January,February,March,April,May,June,July,August,September,October,November,December,Not Sure Yet" /> <txp:zem_contact_select label="" list="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31" /> <txp:zem_contact_select label="Year" list="2007,2008,2009" />
<txp:zem_contact_select label="Time of Day:" list="Morning (Before 11:30 a.m.),Noon (11:30 a.m. to 1 p.m.),Afternoon (Between 1 and 4 p.m.),Evening (After 4 p.m.)" />

Seems to work pretty well for this client… I’m sure it could be improved on.

Offline

#559 2009-02-10 17:53:34

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: zem_contact_reborn 4.0.3.20

@Simon: Off the top of my head, it seems like using the txp:variable tag might work for creating a select menu. Wrap the tag around a couple of escaped PHP blocks — one to create a comma-separated list of dates and one to format today’s date in a way that matches your select options. You could then output those variables as attributes of the zem_contact_select tag (use single quotes to enable parsing tags in attributes):

<txp:zem_contact_select list='<txp:variable name="date_list" />' selected='<txp:variable name="today_date" />' />

I haven’t had occasion to use template variables yet myself, so I’m not 100% sure this would work. Seems like a good place to start, though.

Offline

#560 2009-02-10 19:43:59

jnhuval
Member
From: Houston Texas USA
Registered: 2007-01-22
Posts: 30
Website

Re: zem_contact_reborn 4.0.3.20

I’m using zem_contact tags in 4 different visitor message forms each in separate articles. I’ve using a thanks txp form to post some text (thank you your message has been sent) after the visitor submits the message.

I’m having trouble with one form — after submitting the message it returns to a blank message form rather than displaying the thanks message I’m calling with the thanks_form attribute — I’ve even tried the default thanks and a short inline thanks message yet this form reloads a blank form each time without acknowledging the form was sent. Other than the problem with the thanks message, the form works.

I just updated to 4.0.8 — and the forms are working with the thanks_form attribute in 3 of the 4 forms. I’ve checked the tags and formatting — any ideas what I could be missing?

This is how the tag is used — I took out some of the input fields to shorten the code:

<txp:zem_contact to="homevalue@sterlingresidential.com" subject="Sterling Residential Comparable Summary Request" label="" thanks_form="SRR_Contact_Thanks">
.....form elements for input fields go here.....
<txp:zem_contact_submit label="Send Message" />
<txp:zem_contact_serverinfo name="HTTP_USER_AGENT" label="Browser" />
<txp:zem_contact_serverinfo name="REMOTE_ADDR" label="IP" />
</txp:zem_contact>

Offline

#561 2009-02-11 14:45:15

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

Re: zem_contact_reborn 4.0.3.20

jnhuval wrote:

I just updated to 4.0.8 — and the forms are working with the thanks_form attribute in 3 of the 4 forms. I’ve checked the tags and formatting — any ideas what I could be missing?

I updated two sites to 4.0.8 a few days ago and subsequently found that the thanks_ form attribute no longer works. The thank you message doesn’t appear as it did with 4.0.6. The message does get transmitted. I haven’t got to the bottom of it yet and will be interested to see what your query turns up.

Offline

#562 2009-02-11 16:04:30

jnhuval
Member
From: Houston Texas USA
Registered: 2007-01-22
Posts: 30
Website

Re: zem_contact_reborn 4.0.3.20

joebaich wrote:

I updated two sites to 4.0.8 a few days ago and subsequently found that the thanks_ form attribute no longer works. The thank you message doesn’t appear as it did with 4.0.6. The message does get transmitted. I haven’t got to the bottom of it yet and will be interested to see what your query turns up.

Thanks — I’ve been going through my forms and editing/removing deprecated attributes to match the more recent documentation — as I’ve done that to each form, the thanks attribute (whether default or specified) no longer works in TXP 4.0.8.

(edit) The email does get transmitted upon sending and the visitor is returned the form (with fields now empty) — but no thanks message is transmitted or displayed upon sending.

Thank you for the reply.

Last edited by jnhuval (2009-02-11 16:27:07)

Offline

#563 2009-02-11 16:20:44

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

Re: zem_contact_reborn 4.0.3.20

jnhuval wrote:

the thanks attribute (whether default or specified) no longer works in TXP 4.0.8.

On both my sites, I called up the ZCR tag using a form from within an article so:

notextile. <txp:output_form form="my_contactform" />

Did you do something similar or did you call it from a page or other form?

Offline

#564 2009-02-11 16:44:52

jnhuval
Member
From: Houston Texas USA
Registered: 2007-01-22
Posts: 30
Website

Re: zem_contact_reborn 4.0.3.20

joebaich wrote:

On both my sites, I called up the ZCR tag using a form from within an article. Did you do something similar or did you call it from a page or other form?

My forms are written/coded within an article without using the output_form tag — the top of the article page has some descriptive text followed by the form coding within the article page — so I’m using the write tab when editing my forms. I was using the thanks_form attribute in ZCR to display a specific message upon submittal.

The original forms (before 4.0.8) always worked with “Use Textile” in the article markup — but I haven’t tried without textile to see if I’m getting the same problem with the thanks attribute function.

I’m going to try using your coding to call in the form from within the article to make sure textile isn’t causing the problem and will get back with post later. Thanks.

edit — more info after testing textile

I checked again using notextile. <txp:output_form form="SRR_Contact_CS" /> within the article to load the form and got the same result — the form works and the email is transmitted but the thanks attribute is not functioning whether in default mode or with the attribute thanks=“text” or with the attribute thanks_form=“form”.

Last edited by jnhuval (2009-02-11 17:04:25)

Offline

#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

Board footer

Powered by FluxBB