Sunday 13 November 2005 3:46:28 pm
I'm still not able to get the validation working on my user register or user edit forms. I've tried everything I can think of but nothing seems to work, my forms are simple enough.
---- Required Fields --------------
First Name: [text line]
Surname: [text line]
User Account:
Username: [text line]
Password: [password]
Confirm Password: [password]
Email Address: [email]
---- Optional Fields -------------
Company: [text line]
Address: [text line]
City/Region: [text line]
State: [text line]
Postcode: [text line]
Phone Number: [text line]
----------------------------------
[submit]
The registration form and the user edit form are practically the same apart from one thing. The registration form uses this for validation:-
{section show=$validation.processed}
{section name=UnvalidatedAttributes loop=$validation.attributes show=$validation.attributes}
<div class="warning">
<h4>{'Registration details did not validate'|i18n("design/standard")}</h4>
<ul>
<li>{$UnvalidatedAttributes:item.name}: {$UnvalidatedAttributes:item.description}</li>
</ul>
</div>
{section-else}
<div class="feedback">
<h3>{'Registration successfull'|i18n("design/standard")}</h3>
<p>I need to put a paragraph here</p>
</div>
{/section}
{/section}
While the user form uses an include: {include uri="design:content/edit_validation.tpl"} which looks like this:-
{section show=$validation.processed}
{section show=or($validation.attributes,$validation.placement)}
<div class="warning">
{section show=and($validation.attributes,$validation.placement)}
<h3>{'Validation failed'|i18n("design/standard")}</h3>
{section-else}
{section show=$validation.attributes}
<h3>{'Input did not validate'|i18n("design/standard")}</h3>
{section-else}
<h3>{'Location did not validate'|i18n("design/standard")}</h3>
{/section}
{/section}
<ul>
{section name=UnvalidatedPlacements loop=$validation.placement show=$validation.placement}
<li>{$:item.text}</li>
{/section}
{section name=UnvalidatedAttributes loop=$validation.attributes show=$validation.attributes}
<li>{$:item.name|wash}: {$:item.description}</li>
{/section}
</ul>
</div>
{section-else}
{section show=$validation_log}
<div class="warning">
<h3>{'Input was partially stored'|i18n("design/standard")}</h3>
{section name=ValidationLog loop=$validation_log}
<h4>{$:item.name|wash}:</h4>
<ul>
{section name=LogMessage loop=$:item.description}
<li>{$:item}</li>
{/section}
</ul>
{/section}
</div>
{section-else}
<div class="feedback">
<h3>{'Input was stored successfully'|i18n("design/standard")}</h3>
</div>
{/section}
{/section}
{/section}
Unfortunately both of these validation scripts only honour the user account sections within my forms, they completely ignore my custom required fields within the user class, namely first name and surname. Is there something else I need to do to allow my custom fields to be included in the validation process? Any ideas greatly appreciated. Cheers!
Pardon me while I burst into flames...
|