Forums / Install & configuration / Form not showing results: configuration error?

Form not showing results: configuration error?

Author Message

V. van Velzen

Thursday 18 March 2010 4:48:41 am

Good afternoon,
I'm struggling to get my forms working correctly. I've followed all the steps in the article http://share.ez.no/articles/ez-publish/how-to-create-ez-publish-forms/, but it is not working as it should.

I've got two situations:

1) When submitting a form in which not all mandatory fields were entered, EZPublish returns to the form, but does not show any error message, even though I've added the following code:

{include name=Validation uri='design:content/collectedinfo_validation.tpl'
 class='message-warning' validation=$validation collection_attributes=$collection_attributes}

and the source code of the page does include the validation template:

<!-- START: including template:
design/standard/templates/content/collectedinfo_validation.tpl
(design/standard/templates/content/collectedinfo_validation.tpl) -->

The fields the visitor HAD entered are prefilled.

2) When submitting the form with all mandatory fields entered, I'm again shown the form (no resultpage, no message), which is now empty again. The e-mail with the data is sent (so that works), but the visitor does not get any feedback.

In the debuginformation that is shown in the parsed page it says that the collectedinfo/myform.tpl template has been loaded, but when I look in the source code (where the debug information is placed as comments) it says it has loaded the override/templates/full/myform.tpl and that is the page that I'm seeing (but do not want to).

Redirection proces:
a) http://www.mywebsite.com/index.php/my_registration_form (initial form page)
b) http://www.mywebsite.com/index.php/content/action
c) http://www.mywebsite.com/index.php/content/collectedinfo/3309 (ID of my form, shows an empty form once again, instead of the values that the user had entered in an overview)

In collect.ini.append.php I've got the following entries:

[InfoSettings]
TypeList[myform]=myform

[EmailSettings]
SendEmailList[myform]=enabled

[DisplaySettings] 
DisplayList[myform]=result

[CollectionSettings]
CollectAnonymousDataList[myform]=enabled

Is it possible that my problems have someting to do with the privileges that an anonymous user has? Do I have to give him access to infocollector so that he can see the information he has entered?
I'm kinda at the end of my rope here. I have no idea why this won't work. Any help would be appreciated.
Kind regards,

Vivienne

BTW. I'm using EZPublish version 4.1.3

Yannick Komotir

Thursday 18 March 2010 7:41:03 am

All class collectors attributes must be present in your submit form.

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

V. van Velzen

Monday 22 March 2010 12:30:53 am

Hi Yannick,

Thanks for replying. All class collector attributes are present in my form. The form submits (when all mandatory fields are entered), it just does not show a result page. And when mandatory fields are left empty, EZ returns to the form but does not show an error message...

V. van Velzen

Tuesday 23 March 2010 1:57:01 am

Anyone? Any help would be appreciated...

V. van Velzen

Thursday 25 March 2010 1:11:07 am

Hi all,

Even if you don't know the answer yourself, maybe you could point me to someone who does? It's kinda crucial I get this form working correctly...

TIA,

Vivienne

Nicolas Pastorino

Friday 26 March 2010 7:11:10 am

Hi Vivienne,

Could you tell us what template is used to display this : http://www.mywebsite.com/index.php/content/collectedinfo/3309
An override may be getting in the way there.

Let us know,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

V. van Velzen

Monday 29 March 2010 1:59:48 am

Hi Nicholas,

Thanks for replying. I'm using a custom template for this page, code below:

<h1>{$node.name|wash()}</h1>

        {include name=Validation uri='design:content/collectedinfo_validation.tpl'
                 class='message-warning'
                 validation=$validation collection_attributes=$collection_attributes}

        <div class="attribute-short">
                {attribute_view_gui attribute=$node.data_map.form_intro}
        </div>
        <form method="post" name="myform" class="kasteelseminar" action={"content/action"|ezurl} onsubmit="return checkFields()">
            <p> </p>
            <table width="500" cellspacing="0" cellpadding="0" border="0">
                <tr>
                    <td colspan="2"><strong>Organisation</strong></td>
                </tr>
                <tr>
                    <td>{$node.data_map.naam_organisation.contentclass_attribute.name} *)</td>
                    <td>{attribute_view_gui attribute=$node.data_map.naam_organisation}</td>
                </tr>
                <tr>
                    <td>{$node.data_map.postaddress.contentclass_attribute.name} *)</td>
                    <td>{attribute_view_gui attribute=$node.data_map.postaddress}</td>
                </tr>
                <tr>
                    <td>{$node.data_map.postalcode_city.contentclass_attribute.name} *)</td>
                    <td>{attribute_view_gui attribute=$node.data_map.postalcode_city}</td>
                </tr>
                <tr><td colspan="2"> </td></tr>
                <tr>
                    <td colspan="2"><strong>Attendee 1</strong></td>
                </tr>
                    <td> </td>
                <td>{attribute_view_gui attribute=$node.data_map.attendee_1}</td>
            </tr>
            <tr>
                <td> </td>
                <td>{attribute_view_gui attribute=$node.data_map.gender_1}</td>
            </tr>
            <tr>
                <td>{$node.data_map.name_attendee_1.contentclass_attribute.name} *)</td>
                <td>{attribute_view_gui attribute=$node.data_map.name_attendee_1}</td>
            </tr>
            <tr>
                <td>{$node.data_map.function_attendee_1.contentclass_attribute.name} *)</td>
                <td>{attribute_view_gui attribute=$node.data_map.function_attendee_1}</td>
            </tr>
            <tr>
                <td>{$node.data_map.email_1.contentclass_attribute.name} *)</td>
                <td>{attribute_view_gui attribute=$node.data_map.email_1}</td>
            </tr>
            <tr>
                <td>{$node.data_map.phone_1.contentclass_attribute.name} *)</td>
                <td>{attribute_view_gui attribute=$node.data_map.phone_1}</td>
            </tr>
            <tr><td colspan="2"><p> </p></td></tr>
            <tr>
                <td colspan="2">
                    <strong>Attendee 2</strong></td>
            </tr>
            <tr>
                <td> </td>
                <td>{attribute_view_gui attribute=$node.data_map.attendee_2}</td>
            </tr>
            <tr>
                <td> </td>
                <td>{attribute_view_gui attribute=$node.data_map.gender_2}</td>
            </tr>
            <tr>
                <td>{$node.data_map.name_attendee_2.contentclass_attribute.name}</td>
                <td>{attribute_view_gui attribute=$node.data_map.name_attendee_2}</td>
            </tr>
            <tr>
                <td>{$node.data_map.function_attendee_2.contentclass_attribute.name}</td>
                <td>{attribute_view_gui attribute=$node.data_map.function_attendee_2}</td>
            </tr>
            <tr>
                <td>{$node.data_map.email_2.contentclass_attribute.name}</td>
                <td>{attribute_view_gui attribute=$node.data_map.email_2}</td>
            </tr>
            <tr>
                <td>{$node.data_map.phone_2.contentclass_attribute.name}</td>
                <td>{attribute_view_gui attribute=$node.data_map.phone_2}</td>
            </tr>
            <tr><td colspan="2"><p> </p></td></tr>
            <tr>
                <td colspan="2">{attribute_view_gui attribute=$node.data_map.invitation}
{$node.data_map.invitation.contentclass_attribute.name}</td>
            </tr>
            <tr>
                <td colspan="2">{attribute_view_gui attribute=$node.data_map.agree} I agree to the terms and conditions *)</td>
            </tr>
            <tr>
                <td colspan="2">
                    <p> </p>
                    <input type="submit" class="defaultbutton" name="ActionCollectInformation" value="Send" />
                    <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" />
                </td>
            </tr>
        </table>
        </form>

V. van Velzen

Wednesday 31 March 2010 11:27:52 pm

Can anyone tell me if the template is OK so I can exclude that from being the reason why the form isn't working as it should?

TIA,

Vivienne

Nicolas Pastorino

Thursday 01 April 2010 12:48:01 am

Hi Vivienne,

From your settings above, the template requested when viewing 'content/collectedinfo/3309' should be :
content/collectedinfo/myform.tpl

You will need to have a few things enabled in site.ini.append.php, if not already the case, before we move on troubleshooting :

[DebugSettings]
DebugOutput=enabled

[TemplateSettings]
Debug=enabled
ShowXHTMLCode=disabled
ShowUsedTemplates=enabled
DevelopmentMode=enabled

Would you mind checking in the list of used templates what "Requested template" reads ?

Other than that, what custom override rules (in override.ini for the concerned siteaccess) are in use ?

Let us know,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

V. van Velzen

Wednesday 14 July 2010 12:28:11 am

Hi Nicolas,

My apologies for the terribly late response. I'm counting on the automatic notifications to warn me of any replies, but apparently they're not always working correctly.

Anyway, on with the problem. First off, I can't enable those settings in my site.ini.append.php, as it is a live server and not in a development environment :-(.

The used templates question: I'm guessing you mean the templates that are mentioned in design -> templates? When I look at this page I see an immense list of templates. Filtering on the class name leaves me with these two:

/content/collectedinfo/myform.tpl design/mysite/templates
/content/collectedinfomail/myform.tpl design/mysite/templates

The custom overrides in my override.ini.append.php regarding this form are:

[myform]
Source=node/view/full.tpl
MatchFile=full/myform.tpl
Subdir=templates
Match[class_identifier]=myform

Does this help?

Kind regards,

Vivienne

Gabriel Finkelstein

Tuesday 27 July 2010 3:14:55 pm

Regarding number 1:

I'm completely sure there's an input missing in your form. Bear in mind that for each attribute, at least one POST variable must be submitted, and in some html form elements, when you leave them empty, then no variable is submitted. Such elements are for example radio buttons and checkboxes. If you use them in your form, then be sure to add a hidden input with value="" with the same name as the radio buttons or checkboxes right before them.

Regarding number 2:

You need to add this in override.ini:

[myform_collectedinfo]
Source=node/view/collectedinfo.tpl
MatchFile=collectedinfo/myform.tpl
Subdir=templates
Match[class_identifier]=myform