You are viewing limited content. For full access, please sign in.

Question

Question

A Quick Lesson in Custom Error Messages

asked on September 13, 2017 Show version history

Hey everyone!

 

I've had a great deal of success getting help here on the LF Answers site and am becoming a huge advocate of it... I have a few questions today I'll be posting and hoping to get answers to, however, this one is much more generic in nature. I'm wondering if someone could give me a quick lesson on creating custom error messages in LF Forms. More specifically, probably centered around JavaScript or CSS Classes, if need be.

 

I have a few examples...


On Form 1:
 

1) I have a field where a user has to enter a correct PIN for their database lookup. If I wanted to create a custom error message there that reads "You have entered an invalid PIN for this account." How would I accomplish this?

 

2) I have an auto-suggested list of names to choose from in one field. If they did not select or correctly type a name from that list - how would I create an error message to indicate that? "You must select a name from the list provided."


On Separate Form:
 

3) And this is one I'd LOVE to implement... currently, when a user enters a new PIN, I only have one field for that. So better not mistype it! I'd love to have a second PIN field there, for "Re-type PIN," whereby JavaScript would verify the two fields have the same number in them, and if not, return something like "Your newly entered PINs do not match." Something like that.

 

Anyone want to teach a Java dummy some cool new tricks? Much appreciated in advance! I'm happy to share screenshots or anything you may need to get me going on this front.

0 0

Replies

replied on September 13, 2017 Show version history

You'll want to look into custom parsley validators. They are relatively easy to implement and they will behave just like the built-in validation processes, just using your own custom rules/conditions.

This post and this post both have examples, one of which is pretty close to what you are trying to accomplish with the PIN generation.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.