samedi 30 novembre 2019

How to prevent Action Post method called from Submit form Hit twice?

I have the following control in my .cshtml view:

<"a id="BtnSubmit" onclick="SubmitForm();">

    function SubmitForm() {
       $('#Form_Create_Edit_Customer_Contact_FollowUp').submit();
    }

Where '#Form_Create_Edit_Customer_Contact_FollowUp' is the name of the form.

The problem is that the corresponding controller POST method is being hit twice, how can i stop the current behavior.

Note: i need to use a link rather than Button/Input with type submit for design reasons.




Aucun commentaire:

Enregistrer un commentaire