Forums / Setup & design / Checkbox as info collector not sending data

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