Checkbox as info collector not sending data

Author Message

steve walker

Friday 27 August 2004 7:32:38 am

Hi there,

An information collection form I have setup submits all its information, except data coming from the check boxes.

The form itself shows the check boxes, its just not present in the email that consequently arrives after form submission. Nor is it shown on the 'collected information' summary page shown after you submit your form.

The checkboxes are setup as information collectors within the class.

I havent specified any default values for the checkbox, I assumed a ticked box would result in the value '1' being sent with the email.

The code I have for the check box portion in the form is:

<h2>{"Please register me to receive updates about forthcoming seminars"|i18n("design/base")}</h2>
        <div class="attribute-email">
                <div align="left">{attribute_view_gui attribute=$node.object.data_map.updates}
                </div>
        </div>

Is this wrong? I've copied over same code as is used for the text links?

Any help appreciated.

Thanks, Steve.

http://www.oneworldmarket.co.uk

steve walker

Monday 30 August 2004 4:24:03 am

Hi!

Anyone had any experience using the checkbox in a form? I'm sure I'ved just made a basic error somewhere???

Thanks, Steve.

http://www.oneworldmarket.co.uk

steve walker

Monday 30 August 2004 9:07:59 am

I guess this is to do with: http://ez.no/community/bug_reports/collected_information_templates_need_to_be_expanded

Could one of the Ez Crew give a quick 'yeh' or 'nay'?

Steve.

http://www.oneworldmarket.co.uk

steve walker

Tuesday 31 August 2004 2:21:04 am

OK - its nothing to do with that (now fixed) bug...

The problem seems to be that there is no 'value' tag in the checkbox code. If I view the rendered code I see:

<h2>Please register me to receive updates about forthcoming seminars</h2>
        <div class="attribute-email">
                <div align="left"><input class="box" type="checkbox" name="ContentObjectAttribute_data_boolean_3395"  />                </div>
        </div>

Ideally I want to see something on the lines of value="yes" - template debug tells me its using content/datatype/collect/ezboolean.tpl - I tried hardcoding the value into ezboolean.tpl but the value still didnt show up when you view submitted info.

Anyone out there got any idea on this one?

Cheers, Steve.

http://www.oneworldmarket.co.uk

steve walker

Thursday 02 September 2004 4:27:33 am

Hi there,

Lack of responses to a posting on the forum tends to either mean:

1. Noone has an idea to fix it and I need to ask Ez how to deal with it, or
2. Your question is so basic you should easily be able to find the answer by looking around.

Can someone please let me know if they've have had success using a checkbox on a feedback form, and any thoughts as to why mine might not be working.

Would really appreciate some help, I've got a less than happy customer as a result of this not working and I'd like to make them happier asap...

Thanks, Steve.

http://www.oneworldmarket.co.uk

Mark Marsiglio

Thursday 02 September 2004 4:43:38 am

Steve,

I have a working checkbox information collector on one of my 3.4 installations. We use it to ask respondents if they would like to be contacted, and the emails that are sent include the checkbox item name if it is checked.

When I get to the office this morning I will look at the template code and compare it to what you have...

Thanks
Mark

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

steve walker

Thursday 02 September 2004 5:00:05 am

Mark,

Many thanks for this.

Steve

http://www.oneworldmarket.co.uk

Mark Marsiglio

Thursday 02 September 2004 5:37:01 am

This is the template code that I am using:

<div class="object_title">
<h1>{$node.name|wash}</h1>
</div>
<form method="post" action={"content/action"|ezurl}>

{attribute_view_gui attribute=$node.object.data_map.description}

<p>
<b>Subject:</b><br />
{attribute_view_gui attribute=$node.object.data_map.subject}<br />
<b>E-mail:</b><br />
{attribute_view_gui attribute=$node.object.data_map.email}<br />
<b>Phone Number:</b><br />
{attribute_view_gui attribute=$node.object.data_map.phone}<br />
<b>Message:</b><br />
{attribute_view_gui attribute=$node.object.data_map.message}<br />
<b>Would you like to be contacted about this matter?</b>{attribute_view_gui attribute=$node.object.data_map.contact}<br />
</p>


<div class="block">
        <input type="submit" class="defaultbutton" name="ActionCollectInformation" value="Send" />
</div> 

<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
<input type="hidden" name="ViewMode" value="full" /> 
<input type="hidden" name="RedirectURI" value="{$node.parent_node_id|ezroot}" />
<hr />
Please see our <a href="http://www.myflorida.com/myflorida/privacy.html">privacy policy</a> if you have questions about how we use the information that you provide during feedback. 

</form>

Where Contact is the checkbox attribute. YOu can see the form here (it is live, so responses will go to my client). http://dms.myflorida.com/dms/administration/communications/contact_communications

The attribute is defined in the class like this:
7. I would like to be contacted (Checkbox) (id:205)

Name: I would like to be contacted
Identifier: contact
Is not required
Is searchable
Collects information
Translation is enabled
Default value: Unchecked

I created the override that is included above, but the class also lists three other overrides, presumably from the default 3.4 installation. They are:
1) feedback_form_full /node/view/full.tpl design/standard/override/templates/full/feedback_form.tpl

2) feedback_form_line /node/view/line.tpl design/standard/override/templates/line/feedback_form.tpl

3) feedback_form_mail /content/collectedinfomail/form.tpl design/standard/override/templates/collectedinfomail/feedback_form.tpl

I cannot recall anything unusual that was required during development to implement the checkbox, but I am not 100% sure.

Hope this helps a little...and good luck,

Mark

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

steve walker

Thursday 02 September 2004 8:38:17 am

Mark,

Thanks - your email let me finally work out what was wrong - came from running a couple of test form submissions on your site, basically when I saw the 'collected data' page - submitting a checked box returned the text 'I would like to be contacted' and it got me wondering how you had done this.

The problem I had was this: I didnt realise the checkbox class name was the value that got passed in the form when the box was checked.

As soon as I changed a checkbox name from 'article' to 'I would like to subscribe to articles' everything started to make a lot more sense.

Cheers for the input.

Steve.

http://www.oneworldmarket.co.uk

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:11:54
Script start
Timing: Jan 18 2025 22:11:54
Module start 'layout'
Timing: Jan 18 2025 22:11:54
Module start 'content'
Timing: Jan 18 2025 22:11:55
Module end 'content'
Timing: Jan 18 2025 22:11:55
Script end

Main resources:

Total runtime0.9929 sec
Peak memory usage4,096.0000 KB
Database Queries75

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.0469152.6406
Module start 'layout' 0.00600.0031 740.687539.4766
Module start 'content' 0.00900.9825 780.1641621.3125
Module end 'content' 0.99150.0013 1,401.476624.1250
Script end 0.9929  1,425.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3438160.0002
Check MTime0.00140.1436160.0001
Mysql Total
Database connection0.00080.085010.0008
Mysqli_queries0.916892.3343750.0122
Looping result0.00080.0825730.0000
Template Total0.962496.920.4812
Template load0.00200.197320.0010
Template processing0.960496.732620.4802
Template load and register function0.00020.015410.0002
states
state_id_array0.00060.065410.0006
state_identifier_array0.00130.128320.0006
Override
Cache load0.00190.1879770.0000
Sytem overhead
Fetch class attribute can translate value0.00090.088320.0004
Fetch class attribute name0.00110.1077100.0001
XML
Image XML parsing0.00060.059820.0003
class_abstraction
Instantiating content class attribute0.00000.0024110.0000
General
dbfile0.00200.1977150.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 34
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs