Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > HTML area (formatted text) validation View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
sachin-asentechllc - 10/23/2012 7:36:50 AM
   
HTML area (formatted text) validation
Hi,

I have a HTML area (formatted text) in the form of a doc type in my website. I want to make it a mandatory field. I have made it by not selecting "Allow empty value:" in Document type properties.

If I do not enter anything then validation message is displayed and document is not saved.

If I enter a whitespace or a tab or a new line then in HTML   or <br/> tags are getting added and the empty data is getting stored.

How can I avoid this?

Thanks and regards,
Sachin

User avatar
Member
Member
kentico_edwardh - 10/23/2012 4:22:45 PM
   
RE:HTML area (formatted text) validation
Hello Sachin,

Version 6.0 of Kentico CMS uses CKEditor and the configuration file for CKEditor can be found in ~\CMSAdminControls\CKeditor\config.js. You should be able to modify this file to try and remove the default <br> tag which prevents the validation.

For example, to change the enter behavior, you can use this setting:

config.enterMode = CKEDITOR.ENTER_P;

instead of:

config.enterMode = CKEDITOR.ENTER_BR;

For more information about CKEditor configuration, I would like to point you to this article:http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html

Another alternative would to be develop a custom form control - http://devnet.kentico.com/docs/devguide/developing_form_controls.htm - and validate the content based on some regular expression or your own custom methods.

Best Regards,
Edward Hillard