Validate field value by javascript before submitting an item

More
8 years 4 months ago - 8 years 4 months ago #69849 by Ali_wdm
I want to validate field value of item before submitting using javascript. I know there is a function onBeforeSaveField to achieve this, I think that this function works on server side. I want to validate it on client side using javascript.
Last edit: 8 years 4 months ago by Ali_wdm.

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

More
8 years 4 months ago #69852 by ggppdk
Yes onBeforeSaveField is server side.

I think it is best to make a Faq article for this


-- 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 review. Thanks!

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

More
8 years 4 months ago #69879 by Ali_wdm
Thanks for your reply.
Actually I have some dynamic fields, one of these field should have some value. I want to validate it before submitting item.
As you suggest to read FAQ, that was not my requirement.
I can validate only one field on 'BLUR' event.

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

More
8 years 4 months ago #69893 by ggppdk
Hello

there is a misunderstanding
- i have not asked you to read the FAQ artcile

i said that i want to write a new article
i have not written it yet
(it does not exist yet !)

please answer this question:
is the field that you want to custom validate is a "text/number/custom validation" field ??

(then if it is of the above type, you can add your custom validation via a parameter)


-- 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 review. Thanks!

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

More
8 years 4 months ago - 8 years 4 months ago #69917 by Ali_wdm
Field types are text and select.

How can I validate it via parameter..??
Last edit: 8 years 4 months ago by Ali_wdm.

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

More
8 years 4 months ago #69919 by ggppdk
Hello

yes in text field you can enable "custom" validation

and then configure the custom validation via parameter
also an input "mask" will be shon to the user


-- 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 review. Thanks!

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

More
8 years 4 months ago #69999 by Ali_wdm
How to validate select field...??

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

More
8 years 4 months ago #70001 by ggppdk
hhmm

but select field has preset values
- so it already shows the values that are valid


-- 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 review. Thanks!

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

More
8 years 4 months ago - 8 years 4 months ago #70015 by Ali_wdm
Sorry, I did not get you.

How can I validate some fields on clicking save button of item....??
Last edit: 8 years 4 months ago by Ali_wdm.

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

More
8 years 4 months ago - 8 years 4 months ago #70033 by ggppdk
Hello

all fields have validation when form save is clicked
validation is happening according to parameters

1. most basic validation is "required"

2. chekckbox , chekckbox image, selectmultiple also have
- minumum and maximum number of values

3. multi-property field like address international can also have some properties e.g. "city", "country" as required

4. some field have specific validation e.g. e-mail field, has email format validation, weblink field has URL validation

5. then the free input field "text",
- you can select from a set of a preset validation, e.g "float" e.g. "integer" e.g. "url"
- you can also configure a full custom format + masking (see parameter)

About the select field, it has a preconfigured drop down of values, it does not have free selection !


(Finally irrelevant to your question but i will mention it) even if users hacks the form to submit a different value, the server side validation will reject it
e.g. allowed values 1, 2, 3
and form submits 4 , value will not be saved


-- 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 review. Thanks!
Last edit: 8 years 4 months ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
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