Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jivan thapa 194 posts 681 karma points
    Feb 10, 2011 @ 13:43
    jivan thapa
    0

    How to modify Default DocType Error Message that comes when regex validation is false.

    I use regex validation to limit user input character (max 200) in document type. its works fine but problem is if character goes more than 200 its gives error message which is not descriptive or not much meaning full for other (example editor, publisher) . as a developer i can understand what was problem but other may not be able to identify what's a problem because error message is not decriptive.

     

    "Error in Red Color" it says " Description at Product is not in a correct format";

    how to replace that error message with custom error message for example "Maximum characters 200 are allowed in Description".?

    here is regex validation code to limit character max 200

     

    .thanks in advance

    Jivan

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 10, 2011 @ 14:31
    Tom Fulton
    0

    Hi Jivan,

    I don't believe there's any way to use a custom message here (maybe with a custom datatype?). 

    A slight workaround might be to use the Description field to explain the requirements, for example:  "Enter your description here, must be less than 200 characters" or something along those lines.  I do the same when asking for a URL, I add to the Description "Be sure to include http://", since the regex error doesn't really explain it.

    On a side note, I'm not sure how well that regex will work on a Rich Text field, does it count the HTML as characters also?

    -Tom

  • jivan thapa 194 posts 681 karma points
    Feb 11, 2011 @ 09:36
    jivan thapa
    0

    thanks Tom,

    that regex will count everything including white space.

Please Sign in or register to post replies

Write your reply to:

Draft