gpt4 book ai didi

javascript - 我应该使用什么 Meteor 事件处理程序来提交 onchange 表单

转载 作者:行者123 更新时间:2023-12-03 08:01:28 25 4
gpt4 key购买 nike

我有一个 html 表单,我想在没有提交按钮的情况下提交该表单。我应该使用什么事件监听器?谢谢!

editProfile.html

<form class="edit-profile" enctype="multipart/form-data">
Upload Profile Image:
<Input type="file" name="profileImage" id="profileImage" onchange="this.form.submit()">
<br>

</form>

editProfile.js

    Template.editProfile.events({
"change .edit-profile": function(event){
console.log("works");
}
});

最佳答案

它应该与提交表单一起使用或使用其类,例如:

Template.editProfile.events({
"submit .edit-profile": function(event){
console.log("works");
}
});

关于javascript - 我应该使用什么 Meteor 事件处理程序来提交 onchange 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34564482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com