Jquery Validation plugin : Custom error messages not showing
<p>I am using jquery validation for validating input for my form.  However I have specified my custom messages, but still general messages are being displayed when clicking on submit page.  Here is code for the form: Am I missing something or doing incorrectly:</p>

<pre><code> &lt;script language="javascript" type="text/javascript"&gt;

        $(document).ready(function () {


                $("#emailForm").validate({ rules: {
                    FromMail: {
                        required: true,
                        email: true
                    }
                },
                    messages: {
                        FromMail: {
                            required: "Please enter From email address.",
                            email: "Please enter valid From Email address."
                        }
                    },

                    errorPlacement: function (error, element) {
                        alert("errorPlacement");
                        error.appendTo(element.next());
                    },
                    showErrors: function (errorMap, errorList) {
                        alert("showErrors");
                    }
                });

        });

        function sendMail()
        {
            $("#emailDialog").dialog({ modal: true,
                buttons: { "Send": function () {
                    //$("#FromMail").addClass("ui-state-error");
                    if ($("#emailForm").validate().form() == true) {
                        $.getJSON($("#emailForm").attr("action"),
                            $("#emailForm").serialize(),
                            function (data) {
                                alert(data);
                            });
                    }
                },
                    "Cancel": function () { $("#emailDialog").dialog("close"); }
                }
            });
          }


    &lt;/script&gt;
}

&lt;body&gt;
&lt;div id="emailDialog" title="Email" style="display:none"&gt;
&lt;form id="emailForm" action="@Url.Action("SendMail", "Content")" method="get" &gt;

        &lt;div class="editor-label"&gt;
        &lt;label for="FromMail"&gt;From Email&lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="editor-field"&gt;
        &lt;input id="FromMail" name="FromMail" style="width:200px" class="required email" type="text" value="" /&gt;
        &lt;span class="field-validation-valid" data-valmsg-for="FromMail" data-valmsg-replace="true"&gt;&lt;/span&gt;
    &lt;/div&gt;

    &lt;div class="editor-label"&gt;
        &lt;label for="ToEmailList"&gt;To Email Address&lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="editor-field"&gt;
        &lt;textarea cols="20" id="ToEmailList" name="ToEmailList" rows="2"   class="required email" style="width:200px"&gt;
        &lt;/textarea&gt;
        &lt;span class="field-validation-valid" data-valmsg-for="ToEmailList" data-valmsg-replace="true"&gt;&lt;/span&gt;
    &lt;/div&gt;
</code></pre>

<p>
        
        
    </p>
