如何将表单事件添加到按钮 [英] How to add a form event to a button

查看:68
本文介绍了如何将表单事件添加到按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天

我想将表单的onload事件添加到按钮的onclick事件中.我单击按钮的那一刻,它必须运行表单的onload事件.

有关编码的任何建议或文章?

谢谢

Good day

I want to add the onload event of a form to the onclick event of the button. The moment I click on the button it must run the onload event of a form.

Any suggestions or articles for the coding?

Thanks

推荐答案

那是一种不好的做法.如果是我,我将把Load事件处理程序中的代码移到一个单独的方法中,然后从Load处理程序和按钮click处理程序中调用该方法.
That''s kinda bad practice. If it were me, I''d move the code in the Load event handler into a separate method, and then call that method from both the Load handler and the button click handler.


这篇关于如何将表单事件添加到按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆