Tuesday, 31 December 2019

Validate Jquery function before form submission in mvc

//////////////////  HTML


     <form id="formIDs">
       <input type="text" name="name" id="inputids">
        <br>
       <button type="button" onclick="SubmitRemarks()">Validate!</button>


     </form>



/////////////////////////// JS

<script type="text/javascript">
    function CalFrmSubmit() {
        if ($("#inputids").val() == "") {
            $("#formIDs").valid();
            Alert("Please select fill input");
            return false;
        }
        else {
            $("#formIDs").submit();
        }
    }
</script>

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...