[英]Event firing sequence for a submit button
Say a submit button has a click event handler as well (yes, it's wrong, but that's really the code I'm working on). 假设一个提交按钮也有一个单击事件处理程序(是的,这是错误的,但这确实是我正在处理的代码)。
And the click handler sets a value in a field of the form that's about to be submitted. 点击处理程序在即将提交的表单的字段中设置一个值。
So when the submit button is clicked: 所以当点击提交按钮时:
Note: I'm not looking for alternatives and advice. 注意:我不是在寻找替代方案和建议。 I know what the proper way of handling this will be.
我知道处理这个问题的正确方法是什么。 Just trying to understand the sequence of events and their implications.
只是试图了解事件的顺序及其含义。
First will be called event, there You have last chance f.ex to block form submitting. 首先将被称为事件,你有最后的机会f.ex阻止表单提交。 Then submit with changed values by event routine.
然后通过事件例程提交更改的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.