Hi Everyone,
I have two fields, text and number fields.
If I input "aaa" into text field and "bbb" into number field and put focus on other field, it will pop up an error message, like only numbers can be input into number fields.
BUT, what if I input "aaa" into text field and "bbb" into number field and I just click save.
What I have is that error message popped up but form is saved also.
"aaa" is saved into text field.
My Question is how can I prevent text field saving action in this case?
BTW, I know I can use context.getEventArgs().preventDefault() for customized validation.
Thank you,
Kei
*This post is locked for comments
Thank you, Yadnyesh. I know I can do customized validation in JavaScript. As I mentioned, I don't want to do like this, since I need to code for several kinds of date type.
No. It is not given by system, but in JavaScript you can use regex. You should be able to get ready code on google.
How? Is this provided by system?
In that case there is other option than a custom JavaScript validation. You can check values against regular expressions to validate your data.
Kindly mark verify answer if this resolves your problem.
Thank you for your reply, Yadnyesh.
I can do customized validation. But I need to add a lot of codes for Date, Number, Alphabets. I can't determine fields required or not.
Is there any way I can get validation result from system?
Thank you,
Kei
EAny reason you don't want to go for customized validation using preventDefault?
Also, if you make both fields required, then you should receive a message without saving values.
Thanks and regards,
Yadnyesh Kuvalekar
...
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156