Kentico Form Validation

Jason Levy asked on April 11, 2017 20:00

I am working on a form and I want to validate to ensure a drop-down list is not the default value when the form is submitted and to display error message. Can I do this with in the CMS or do I need to use javascript or macro to validate?

Correct Answer

Rui Wang answered on April 11, 2017 20:43

The simple way to do this is, use the the built-in validation like "value cannot be 1",

Then you can populate you list of options like the following, which the Default (Please select) will give you 1 for the value and it will be invalid.

1;Please select
value1;option 1
value2;option 2
value3;option 3
0 votesVote for this answer Unmark Correct answer

Recent Answers


Jason Levy answered on April 11, 2017 21:53

Rui,

Thanks for this. I've implemented your suggestion but I have one follow up. Where do I set the built-in validation rule?

Under validation in the field setting?

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on April 11, 2017 22:00 (last edited on April 11, 2017 22:24)

Yes, click the button to add a validation rule. Something like this. Also be sure to check the field as required (toward the top of the properties).

Image Text

0 votesVote for this answer Mark as a Correct answer

Jason Levy answered on April 12, 2017 17:06

Rui, this solution works perfectly for me. I look forward to playing with more of the build in rules and eventually creating some of my own.

0 votesVote for this answer Mark as a Correct answer

jenn singh answered on October 12, 2017 12:36

We know that the way to get the free musically likes and followers online at this website and you can generate the likes online from this website to have the followers.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.