Skip to Content.
Sympa Menu

en - Re: [en@sympa] Evaluating input in form fields

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: address@concealed
  • Subject: Re: [en@sympa] Evaluating input in form fields
  • Date: Thu, 17 Nov 2022 09:41:57 +0100

Hi Tim,

The thing is : the templates are evaluated before the user starts filling the form.

I would rather use _javascript_ to validate the form on the client side before submitting it. I'm far from being a _javascript_ ace, so I won't give you code samples, but all you have to do is modifying header.tt2 to either put your _javascript_ code or include a _javascript_ fil that you could put ni static_content.

Hope this helps.

Regards,

David

On 16/11/2022 22:25, Silvers, Tim wrote:

So, is there no one doing this? Do the developers have any suggestions? I would rather not start modifying the Sympa code to hack this in and then have to monitor and fix it as upgrades clobber my changes.

 

Thanks,

 

Tim

 

From: address@concealed <address@concealed> on behalf of Silvers, Tim <address@concealed>
Date: Tuesday, November 15, 2022 at 1:58 PM
To: address@concealed <address@concealed>
Subject: [External] [en@sympa] Evaluating input in form fields

This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.

 

Hi. Has anyone customized Sympa to perform any form field input validations? In our case, we would like to ensure that any created lists include a “-L” (i.e., dash el) in their names. The code is in create_list_request.tt2 and I have been reviewing the template directives [1] in an attempt to find a solution. Perhaps a FILTER would work? Or a PERL block?

 

Here is the code from create_list_request.tt2:

 

<input type="text" id="listname" name="listname" size="30" value="[% saved.listname %]" />

                <!-- CODE CHECK FOR DASH EL IN LIST NAME -->

                [% IF saved.listname !~ '<chars>-L$' %]

                   [% SET saved.listname = ${saved-listname} _ '-l' %]

                [% END %]

 

[1] http://www.template-toolkit.org/docs/manual/Directives.html#section_Conditional_Processing

 

Tim

 

-- 
"Mieux vaut viser la perfection et la rater que viser la médiocrité et l'atteindre."
- Francis Blanche

David Verdin
Chef de Projet Collaboratif
Département PROduits NUMériques
Direction des Services Applicatifs
RENATER - Rennes

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature




Archive powered by MHonArc 2.6.19+.

Top of Page