Tester le contenu d'un champ avant de l'accepter

More
12 years 3 weeks ago #30200 by seabird
Bonjour,

Est-il possible de tester le contenu d'un champ avant de l'accepter ? Par exemple etre sur que le texte rentré soit un numéro de téléphone.

Normalement, je fais çà par REGEX mais la je ne sais pas si c'est possible

Eric

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #30207 by micker
De base non... il faudrait faire ca en javascript ...en override du formulaire de soumission ...
Sinon utiliser un composant de formulaire genre chronoform qui envoie les valeurs dans tes champs flexi ... regarde la faq tu trouveras des pistes pour tout

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #30209 by seabird
ok je regarde ça, merci

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #30215 by ggppdk
Form validation has been enhanced a lot lately,

adding such validation for text field (number, decimal, floating etc) is important the way to do it is to load a different validate.js file, than the one included in flexicontent

for numbers the validation already exists in validate.js

it is :
Code:
this.setHandler('numeric', function (value) { regex=/^(\d|-)?(\d|,)*\.?\d*$/; return regex.test(value); } );

to use it TEMPRORARILY HACK the plugin file text.php

and do something like ...
Code:
if ($field->id == 46) $class .= " validate-numeric ";

If you are a developer it will be easy,

Final version is almost done, this parameter is included for the text field, you will only need to edit the configuration


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #30218 by ggppdk
and replace:

... class="inputbox'.$required.'" ...

with

... class="inputbox'.$required.@$class'" ...


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #30241 by seabird
Thanks , I'll try this

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.450 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline