locked
Show "passed" image after regular expression validation in Field template of dynamic data project RRS feed

  • Question

  • User1322635947 posted

    When user input data, how to show "passed" sign (text or image) after validating an regular expression validator. Here is a similar question but I have no idea how to do in Dynamic Data project.

    Example:

    Thanks

    Thursday, June 9, 2011 4:39 PM

Answers

  • User-1770227574 posted

    Hi r6321426,

    However, my question is how to show up an image (a passed icon, not error icon) or text such as the sentence

    I suppose you want the validation fires when the control loses focus, which can be done with javascript. I suggest you consider using jQuery validation plugin.

    Here is a demo with souce code, please check out http://jquery.bassistance.de/validate/demo/milk/

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 16, 2011 2:46 AM

All replies

  • User-269404413 posted

    your question is not clear, could you explain in depth.

    Friday, June 10, 2011 3:54 AM
  • User1322635947 posted

    Can you take a look again?

    Thank you.

    Friday, June 10, 2011 9:15 AM
  • User-1770227574 posted

    Hi r6321426,

    This may help  Use image for error display in ASP.Net validators

     

    Regards

     

     

    Tuesday, June 14, 2011 4:52 AM
  • User-269404413 posted

    Can you take a look again?

    Thank you.

    this is very easy, have an look at this

    <iframe style="width: 55px; height: 62px;" class="twitter-share-button twitter-count-vertical" title="Twitter For Websites: Tweet Button" src="http://platform0.twitter.com/widgets/tweet_button.html?_=1308123016680&count=vertical&id=twitter_tweet_button_0&lang=en&original_referer=http%3A%2F%2Fdailydotnettips.com%2F2011%2F01%2F26%2Fasp-net-validation-control-with-images-notification%2F&text=ASP.NET%20Validation%20Control%20with%20Images%20Notification%20-%20Daily%20.Net%20Tips&url=http%3A%2F%2Fdailydotnettips.com%2F2011%2F01%2F26%2Fasp-net-validation-control-with-images-notification%2F&via=dailydotnettips" frameborder="0" allowtransparency="" scrolling="no"></iframe> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

    Most of the time we used simple text messages for error notifications when ASP.NET validator  control fails the validation. But the interesting things with ASP.NET validation controls is instead of simple text we can display images as error notification. Not only images we can embed sounds or we can display some html format text as well.

    To achieve instead of  setting ErrorMessage property of an Validation control, you need to set Text Property with proper HTML content.

    image

    image

    Not only images, you can also display additional information as an html content or normal text message.

    image

    image

    ref this and this

    Wednesday, June 15, 2011 3:32 AM
  • User1322635947 posted

    Thank you for all of your replys. I think that I didn't clear my question very clear. Sorry about it.

    I know how to display error image if user input wrong stuff. However, my question is how to show up an image (a passed icon, not error icon) or text such as the sentence, "class title is right", if user input right format according to regular expression.

    Wednesday, June 15, 2011 8:55 AM
  • User-1770227574 posted

    Hi r6321426,

    However, my question is how to show up an image (a passed icon, not error icon) or text such as the sentence

    I suppose you want the validation fires when the control loses focus, which can be done with javascript. I suggest you consider using jQuery validation plugin.

    Here is a demo with souce code, please check out http://jquery.bassistance.de/validate/demo/milk/

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 16, 2011 2:46 AM
  • User-330204900 posted

    Hi r6321426, I get what you want and I will have a look at it tomorrow :) sound's like a good idea to me, a bit of positive reinforcement.

    Thursday, June 16, 2011 12:13 PM