Need some help with forms

Author Message

Jan Krabbenbos

Tuesday 26 August 2003 2:30:21 am

Hi,

I want to create a form that any anonymous user can fill out to participate in a tournament. After the form is sent, the information must be put into the database and can be shown in a list of participants on the site.

One (easy) way is doing this through standard information collection and let the form send a mail to some operator. But this still gives some non-automated manual work, which is not wanted.

I have been looking through the forums and the documentation. Somebody mentions to make an normal class which can be used like in the admin interface to fill out and saved into the db. In that case for this class the anonymous role must be adapted so anybody can create an entry. My problem is how do I show an input template as a form that takes care of the input and saves it as an object into the database? And how do I create a link to that form? Could I use a 'full.tpl' template and adapt it for input? Actually it should be like in the admin interface to fill out the info.

Thanks,
Jan

Bjørn Kaarstein

Tuesday 26 August 2003 2:50:26 am

Hi.

You might want to check out the templates used to create new instances of the classes in the admin interface. I assume that you can reuse much of this template-code.

It can also be useful to "view source" when creating an instance of a class in the admin interface. Take a look at the buttons and see what they are called. This might help you to find out what names to use on the buttons. These are predefined by EZ.

You can also take a look on the forum-templates if you install with demo-data. The forum does what you are looking for here, I assume.

I can post some small forum examples if you want.

Regards Bjørn

Jan Krabbenbos

Tuesday 26 August 2003 6:26:28 am

Thanks Bjørn,

This is precisely what I wanted. I had not checked the demo fully. At the moment I have created a rough working version for my participants list and they only thing left is how to shorten the text input fields from 70 to something shorter, so the layout looks good. Seems that I have to override ezltext.tpl.

Thanks,
Jan

Bjørn Kaarstein

Tuesday 26 August 2003 3:03:16 pm

Hi Jan.

A little hint for your input field width. Check the "core.css" stylesheet. Also take a look at this thread:

http://ez.no/developer/ez_publish_3/forum/setup_design/input_fields_in_a_form_each_with_a_different_width

Regards Bjørn

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 19 2025 00:16:49
Script start
Timing: Jan 19 2025 00:16:49
Module start 'layout'
Timing: Jan 19 2025 00:16:49
Module start 'content'
Timing: Jan 19 2025 00:16:49
Module end 'content'
Timing: Jan 19 2025 00:16:49
Script end

Main resources:

Total runtime0.0185 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0092 587.9141152.6250
Module start 'layout' 0.00920.0031 740.539139.4453
Module start 'content' 0.01230.0040 779.984489.2109
Module end 'content' 0.01630.0021 869.195334.3047
Script end 0.0185  903.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002513.7027140.0002
Check MTime0.00115.9116140.0001
Mysql Total
Database connection0.001910.522910.0019
Mysqli_queries0.004222.801830.0014
Looping result0.00000.103010.0000
Template Total0.001910.010.0019
Template load0.00105.443010.0010
Template processing0.00084.541810.0008
Override
Cache load0.00073.925210.0007
General
dbfile0.00021.296480.0000
String conversion0.00000.052840.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