Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Checking field and adding a warning to a newly created document type View modes: 
User avatar
Certified Developer 8
Certified Developer 8
nrinat-ecentricarts - 7/24/2013 10:44:21 AM
   
Checking field and adding a warning to a newly created document type
Hello

I have created a new document type in K7 for showing news items.
I would like to check the length of the title field and give a warning if it is larger than 50 characters. I do not want it to be a validator because all I want is the warning; the user can still save the new document.
I am not sure how to do this. Does this require a macro? If yes, where do I put it? Can you help with the syntax? (I did not find a Length property in the documentation).

Thank you!

Norm

User avatar
Certified Developer 8
Certified Developer 8
Petr Dvorak - 7/24/2013 1:07:41 PM
   
RE:Checking field and adding a warning to a newly created document type
Hi,

when the warning should be displayed? After you submit the form (but then it is actually not very useful, because the form has been saved) or dynamically during filling in the form?

As far as I know there is no way to display warning -- you can specify only a validator (which will throw an error). You can create your own form control which will pass validation but will display the warning. Or you can simply use some javascript code to dynamically check length of the text and hide/display warning as the user types.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 7/24/2013 4:02:07 PM
   
RE:Checking field and adding a warning to a newly created document type
Hello Norm,

Yes, I can confirm that Petr's solution is really correct and displaying just a warning is actually not supported by default.. but you are able to create a customized solution for this scenariou.

Best Regards,
Martin Danko

User avatar
Certified Developer 8
Certified Developer 8
nrinat-ecentricarts - 7/25/2013 9:31:51 AM
   
RE:Checking field and adding a warning to a newly created document type
Thank you both!