让一个输入字段自动更新另一个输入字段,反之亦然(可能使用 JavaScript)
我在 JavaScript 方面经验不足,因此需要一些项目帮助。
我有一个表单,其中包括 3 个输入文本字段(我们称它们为 A、B 和 C)。我需要用户只能输入 A+B OR C。因此,一旦用户单击另一个表单字段(反之亦然),是否可以使表单字段处于非活动状态。
非常感谢任何帮助。我的猜测是这不需要在 JavaScript 中完成。
I'm not that experienced in JavaScript, so need som help with a project.
I have a form of, among other things, 3 input text fields (let's call them A, B and C). I need the user to only be able to type into either A+B OR C. So is it possible to make a form field inactive, once the user clicks in another (and vice versa).
Would really appreciate any help. My guess is this needs t be done in JavaScript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
HTML
JavaScript
HTML
JavaScript
您可以为此编写一个 JavaScript,如下所示进行绑定
您还可以动态绑定事件而不是内联,请参阅 Javascript 绑定事件监听器的四种方式
you can write a javascript for this which is bind as follow
you can also bind the events dynamically instead of inline see Four Ways Javascript Binding Event Listeners