-1

So I read this post but it is not helping at all, I tried to do the same and is not working.

I have this button:

<button id="btnCancel" type="button" class="cancel" name="btnCancel" value="Cancel" onclick="onCancel()">Cancel</button>

Which cleans my form, and causes validation (which I want to remove)

What am I doing wrong?

EDIT: OnCancel function:

function onCancel()
{
    $('#ddlConfigTypeName').val("")
    $('#ddlThreshold').val("")
    $('#ddlValueTypeName').val("")
    $('#txtbLocation').val("")
    $('#txtbLimit').val("")
    $('#QueueMonitorConfigurationsID').val(-1)
    $("#valSummary").empty();
}
4

1 回答 1

0

解决了它:

    $('form').find("[data-valmsg-summary=true]")
         .removeClass("validation-summary-errors")
         .addClass("validation-summary-valid")
         .find("ul").empty();

不知何故,只有我在这里找到的这个解决方案对我有用。它甚至不是该帖子中标记的正确答案。

于 2013-06-12T16:32:43.873 回答