Issue with GTM and asp.net webforms with two submit buttons

那年仲夏 提交于 2019-12-24 00:26:10

问题


Just wanted to share a discovery when using Google Tag Manager (GTM) and two submit buttons in a form-tag (common legacy asp.net Webforms tech).

GTM is used by website editors. So the developers doesnt need to be involved when other scripts or event needs to be implemented or traced.

The problem is that something in GTM is making our form to always trigger the default submit button (the first in order is default).

Example problem/how to reproduce: in a wizard scenario, with back and next submit buttons, which are triggering a postback. Click on next is triggering the back button.

Removing the GTM code, and it works.

This is a legacy site. Maybe a legacy issue, but the site worked until we implemented GTM.

You may ask me now, what components are we using in GTM. Well google analytics is one, then i don't know.

Regards.


回答1:


Work-around solution: I had to rebuild the HTML to NOT use "input type=submit". Instead use buttons without submit behavior. eg not use "postbacks" on one of the buttons.

Probably something for the GTM team to look at or inform.



来源:https://stackoverflow.com/questions/41717000/issue-with-gtm-and-asp-net-webforms-with-two-submit-buttons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!