Contact us form unique field

Chetan Sharma asked on February 26, 2015 15:09

How can we make a field like email-id unique in contact us form?

Any way it possible out of the box?

Thanks Chetan

Recent Answers


Filip Ligač answered on February 26, 2015 16:31

Hello Chetan,

I am afraid there is no way how to make the form field unique with out of the box functionality in Kentico. You would need to create a custom form control or modify the existing ones to achieve it.

Documentation for developing custom form controls can be found here - Developing form controls.

Your custom validation should be performed in the IsValid() method where you can also specify the custom error message.

Best regards,
Filip

0 votesVote for this answer Mark as a Correct answer

Reza Zareian Fard answered on February 27, 2015 15:26

Chetan Sharma,

Here is some workarounds comes to my mind depending on what you want to achieve:

If you want to just show a message whenever user entered an existing field data you may use General Condition validation rules on the field which allows you to define a Macro rule and I think with a macro method you can check if the value exist or not. I have never test it but may it worse to give it a go!

https://docs.kentico.com/display/K8/Designing+forms+using+the+Form+builder

But if you want to generate a unique value while adding a record, you may use default value macros and generate for example add to max of that field.

https://docs.kentico.com/display/K8/Reference+-+Field+editor

0 votesVote for this answer Mark as a Correct answer

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