locked
How to add custom validation message just below the mvc textbox using jQuey. RRS feed

  • Question

  • User-1148373670 posted

    Hi All,

    How to add custom validation message just below the mvc textbox using jQuey. For example-

    I want to display some text message like "Text box could not be empty" just below the textbox using jQuery.

    For above query, anybody have solution for this. Please let me know the solution as soon as possible

    Thanks in advance.

    Ambrish

    Friday, November 29, 2013 7:01 AM

Answers

All replies

  • User71929859 posted

    You can use jQuery Validation - http://jqueryvalidation.org/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, December 1, 2013 7:29 PM
  • User-1148373670 posted

    Hi,

    Thanks for reply,

    I have following html code.

    <td class="fields-table-editor fields-table-editor-string fields-table-editor-termsconditiondescription fields-table-col-2" colspan="3">
    <input class="textfield" data-val="true" data-val-length="The field Description must be a string with a maximum length of 100." data-val-length-max="100" data-val-required="The Description field is required." id="TermsConditionDescription" name="TermsConditionDescription" placeholder="" type="text" value="">
    
    <input id="Original_TermsConditionDescription" name="Original.TermsConditionDescription" type="hidden" value="">
    
    <span class="field-validation-valid" data-valmsg-for="TermsConditionDescription" data-valmsg-replace="true">
    </span>
    </td>

    and just beolw the text box, i want to display erroor message using jquery.

    Please provide some code example to sove this issue.

    Thnaks,

    Ambrish

    Monday, December 2, 2013 1:05 AM