Re: [SMARTY-GENERAL] Preview of Form Plugin
| From: | Valerio Santinelli | Date: | Fri, 05 Apr 2002 07:07:26 +0000 |
| Subject: | Re: [SMARTY-GENERAL] Preview of Form Plugin | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3503@lists.php.net to get a copy of this message | ||
Do you save all the fields values from one step to the next?
It would be nice to be able to collect data in a persistent way so that the
user can step forward and backward and still retain entered values. That way
you could save everything during the final step.
--
Valerio Santinelli
HateSeed.com Founder (http://www.hateseed.com)
In Flames Italia Webmaster (http://www.inflames.it)
My Lab (http://tanis.hateseed.com)
----- Original Message -----
From: "Roberto Berto" <roberto@berto.net>
To: <smarty-general@lists.php.net>
Sent: Thursday, April 04, 2002 10:11 PM
Subject: [SMARTY-GENERAL] Preview of Form Plugin
> Note:
>
> The Form Plugin isn't only a custom function, but a set of custom
functions
> and a prefilter.
>
>
> Download:
> http://www.under.com.br/ourcms/form_plugins-release_alpha.zip
>
> Installation:
>
> All php files should be added to your smarty plugin directory. There are a
> .tpl example. Try run it to see the Form Plugin in action.
>
>
>
> Purpose:
>
> Make all the Form Validation - server and client side (todo)
> Printout Validation errors together to the Form if error
> Process the Current Form Step and increment Step counter if no error
>
>
>
> Form Overview:
>
> {formprocessor name="ProcessorOne"}
> {step}
> {form name="formTest" action="form.php" method="get"}
> {if $form_sucess == FALSE}
> {section name=error loop=$form_errors}
> {$form_errors[error].element}
> {$form_errors[error].key}
> {$form_errors[error].value}
> {/section}
> {/if}
> {/form}
> {/step}
> {step}
> {form name="formTest" action="form.php" method="get"}
> {/form}
> {/step}
> {/formprocessor}
>
>
> - Allways start and end with {formprocessor} tag. This tag may have a name
> attribute.
> - You can add how many steps you want. {step} is required. Min steps is
two.
> - You can add text before {form} and after {/form}
> - If form return error, $form_sucess will be FALSE
> - The errors will be assigned to $form_errors and will have tree
parameters:
> element - is the name of the form element that have error
> key - is the validation type part
> value - is the validation value part
>
> All form tags need be called from {} instead <>. If you want a tag have
> validation, you should add
> the attribute validation to it.
>
> Eg:
> {input type="text" name="name" value=$smarty.request.name
> validation="min_lenght=4&max_lenght=20"}
> Where min_lenght is the type part of validation and 4 is the value part.
>
> The validation will be both min_lenght more than 4 and max_lenght more
than
> 20.
>
>
>
> Each validation type will be a file at plugins dir named:
> shared.validation.TYPE.php
>
> And the function name should be:
> smarty_validation_NAME
>
> Will be passed two parms to the functions:
> $element, $value
>
> $element is the element name. Should be used a $_REQUEST["$element"] to
get
> it value
> $value is the value part of validation that is used to compare something.
>
> The function should return FALSE if want return a error, or TRUE if dont
> will
> return error. Set of TRUE and FALSE is required.
>
>
> More details soon.
>
>
>
>
> TODO:
>
> - add more validation functions
> - create javascript part
> - add some javascript validations
> - add "auto complete" to change the input value="" and input type=checkbox
> and radio CHECKED, etc - when error
>
>
> Please, comment the Form Plugin. I'm needing your feedback.
>
>
>
>
>
> Atenciosamente,
>
> ----------------------------------------
> Roberto Bertó
>
> Under Development
> http://www.under.com.br
>
> Tel: 51 32270599
> Cel: 51 91169628
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>