Problems with form validation

Author Message

Markus Bader

Tuesday 20 March 2007 3:58:12 am

Hello together!

I am working on a site which uses the plain site (means I do not have the class "Feedback form") and I am trying to build a contact form. Unfortunately this topic is not well documented, so I please you to help me.

I have already made a class and a template, which looks like this:

<i>
<form method="post" action={"content/action"|ezurl}>
<input type="hidden" name="TopLevelNode" value="{$node.node_id}" />
<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" />

Name
<input class="inputbox" type="text" name="ContentObjectAttribute_ezstring_data_text_309" value="" /><br/>
<br/>

{* other input boxes *}

<input type="checkbox" name="ContentObjectAttribute_ezstring_data_text_316" value="" /> Ich möchte bei neuen Aktionen informiert werden<br />
<br />

<input type="submit" class="button" name="ActionCollectInformation" value="Abschicken" />

</form>
</i>

The problem is that I have to fill all Elements of the form (including clicked checkboxes) to send the form. If just one entry is missing, nothing happens.

I copied templates named <i>content/collectedinfo_validation.tpl, content/collectedinfo/form.tpl and content/collectedinfomail/form.tpl</i> into the template directory of my extension, but again this effects no change.

What I need is a possibility to control, which form elements have to be filled and which not. I hope you can help me.

Thank you!

Markus

(from Germany, known for bad English ;) )

luca maroni

Sunday 25 March 2007 8:28:40 am

You can set which attributes of your class are required and which not.

If you'll try to edit your custom class for the "feedback form", you see that for each attributes you have a "required" check box. please select that check box only for the required attibutes.

I think this can solve your problem.

Bye bye
Luca
( Spaghetti English ;-) )

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 30 2025 22:26:24
Script start
Timing: Jan 30 2025 22:26:24
Module start 'layout'
Timing: Jan 30 2025 22:26:24
Module start 'content'
Timing: Jan 30 2025 22:26:24
Module end 'content'
Timing: Jan 30 2025 22:26:24
Script end

Main resources:

Total runtime0.0253 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.1328151.2109
Module start 'layout' 0.00680.0035 739.3438220.6875
Module start 'content' 0.01030.0135 960.0313997.6797
Module end 'content' 0.02380.0015 1,957.710929.9922
Script end 0.0252  1,987.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003212.7256140.0002
Check MTime0.00145.6360140.0001
Mysql Total
Database connection0.00145.582210.0014
Mysqli_queries0.00228.526230.0007
Looping result0.00000.090610.0000
Template Total0.00104.110.0010
Template load0.00083.133510.0008
Template processing0.00020.925310.0002
Override
Cache load0.00062.274210.0006
General
dbfile0.00187.251880.0002
String conversion0.00000.019840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs