【发布时间】:2016-07-18 01:13:25
【问题描述】:
我的 Web 表单使用 asp:CustomValidator 验证,因此 ASP.NET 写出 <form method="post" action="./MyPropertiesEnquiry.aspx?rwndrnd=0.30325462348842547" onsubmit="javascript:return WebForm_OnSubmit();" id="form1"> 以及
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
只有在验证成功后我才需要向 Google Analytics 发送命中事件,因此我认为我需要在 return true; 之前插入我的代码。
我已经看到了一个几乎解决方案here
但插入的代码对我来说位置错误(它位于 WebForm_OnSubmit() 的开头)。
【问题讨论】:
标签: javascript c# asp.net webforms