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.