监听器停止执行

编程入门 行业动态 更新时间:2024-10-25 06:30:17
本文介绍了监听器停止执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

每当我在页面上有一个ASP.NET按钮时,如果某些客户端检查失败,我不想将其发回服务器,我只需要按下JavaScript按钮即可。 event return false:

Whenever I have an ASP.NET button on a page that I don''t want to post back to the server if some client side check has failed I simply have the button''s JavaScript "onclick" event return false:

展开 | 选择 | Wrap | 行号 推荐答案

@Frinavale 我也想知道这一点(已经尝试了几天,但到目前为止没有成功) 如果那条路线失败我只能想象一下仅限Javascript路由,删除提交按钮并在验证成功时执行form.submit()。 note:根据DTD,< input>是一个空元素(如果验证很重要) @Frinavale I''d like to know that too (trying already some days on that, but no success so far) If that route fails I can only imagine a Javascript only route that removes the submit button and does a form.submit() on validation success. note: as per DTD, <input> is an empty element (if validation matters)

起初我认为我可以通过指定我正在处理事件来做到这一点....(从这里得到了想法但是在阅读这篇文章)我认为你必须指明你正在处理事件和阻止事件冒泡回来。 例如: At first I thought that I might be able to do this by specifying that I''m handling the event....(got the idea from here but realized where I was going wrong after reading this article) I thought that you have to specify that you are handling the event and stop the event from being bubbled back up. For example: 展开 | 选择 | Wrap | 行号

我非常难以忍受:( 关于下一步研究的内容我已经用完了...... I''m so incredibly stuck :( I have run out of ideas on what to research next....

更多推荐

监听器停止执行

本文发布于:2023-11-12 18:50:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582257.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:监听器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!