How to submit ASP.NET with JavaScript after custom validation

前端 未结 3 1944
一生所求
一生所求 2020-12-16 02:16

I need to fire some custom JavaScript validation and then submit my ASP.NET using JavaScript.

How do I submit the form using JavaScript?

3条回答
  •  猫巷女王i
    2020-12-16 03:02

    It should be as simple as

    document.forms[0].submit(); 
    

    Provided, you only have one form on the page, or else you need to use the form name instead of the index 0.

提交回复
热议问题