[FAQ article corrected] About adding custom form field validator

More
9 years 11 months ago - 9 years 11 months ago #55915 by kath
hi there,

[My Question]
how can i add a custom css-class to my custom field? (my relevant field-types are "text" and "select".)

[Details]
I'm trying to achieve a custom form field validation as described here:
www.flexicontent.org/documentation/faq/7...xicontent-field.html
You suggest to "1. Adding a custom class name to a form field (input or select form fields) e.g. validate-myvalidateclass".

[Followup-Question]
On the above link, under 1. you talk about "validate-myvalidateclass" and
under 2. you give a code example containing "document.formvalidator.setHandler('username',"
Question here: are the two example-strings the same thing? E.g. would i 1) give my custom field 'color' a class like "validate-color" and 2) setHandler('validate-color', [...]
?

[my setup]
J 3.4.3
FC 3.0.0

thanks a lot for your heads-up!
best regards,
kath :)
Last edit: 9 years 11 months ago by ggppdk.

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

More
9 years 11 months ago - 9 years 11 months ago #55918 by ggppdk
Hello

i corrected the names in the FAQ article

it should be (FC text field can be configured to have this class, so you do not need to add new field type):
Code:
<input ... class="validate-myvalidatename" ... />
Code:
jQuery(document).ready(function() { document.formvalidator.setHandler('myvalidatename', function (value) { // do so tests some_true_false_result = ...; return some_true_false_result; } ); });


-- 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...
Last edit: 9 years 11 months ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.679 seconds
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
Save