Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Adding watermark to a field View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 10/3/2012 3:53:29 PM
   
Adding watermark to a field
Hi Guys,

In document type most of the fields have watermark feature.

Any ideas why Email field doesn't have it?

Has anyone found a way to add a watermark on email field?

Thanks
Gitesh Shah

User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/4/2012 3:30:08 AM
   
RE:Adding watermark to a field
Hello.

Well, it was decided that this Watermark functionality will be available for TextBox only, so it is by design behavior. I am not aware of particular reasons for it, however, I was told we might consider changing it in some of next releases and expand its support to some controls as well.

Currently, if you want to use Watermark functionality for an e-mail field, I would recommend using a TextBox and validate e-mail address using the regular expression. Thank you.

Best Regards,
Radek Macalik

User avatar
Member
Member
matthew.newby-crl - 7/9/2013 8:48:08 AM
   
RE:Adding watermark to a field
We've been putting a "*" in the TextBox fields to indicate that a value is required, and in our QA testing practically all the testers are noting that the email field is required but not visibly flagged as such. Any progress on adding watermark capabilities to email fields in the Kentico BizForms?

Assuming that this feature is NOT part of the 7.x releases, your suggestion to use a RegEx to validate emails in a TextBox seems to be the only alternative. I'm sure you're aware that building a regular expression to properly validate emails is a non-trivial undertaking. One thread on StackOverflow has 45 different answers to the question of "What's the best regular expression you have or have seen for validating emails?" (http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address) Couple that with the imminent arrival of some 2000 new top-level domains, and the validity of these answers gets called into question. Bottom line, simple RegEx's will either pass invalid emails or fail valid ones (or both), and even highly complex RegEx's struggle to meet IETF specifications (RFC 822, RFC 5322, etc.) for current TLDs, let alone the freight-train of new ones inbound.

Is there any way to access the built-in Kentico email validation code/function while using the TextBox field type? Alternatively, can you tell us what the internal email validation RegEx is?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 7/16/2013 7:05:26 AM
   
RE:Adding watermark to a field
Hello.

No, this functionality is not part of KCMS 7.0 release, but it is submitted as feature request and our devs will consider it for future version.

So far, I can provide regex we use to validate e-mails:

string defaultRegExp = CustomEmailRegExpString ?? @"^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$";

Best Regards,
Radek Macalik

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/9/2013 12:51:32 PM
   
RE:Adding watermark to a field
See post here: http://devnet.kentico.com/Forums/f65/t38723/Adding-watermark-to-an-email-fiel.aspx