需要文本字段
我想从一组文本字段中要求我的文本字段,以便如果填充任何文本字段,则表格将提交
<div class="row">
<div class="border border-dark d-flex">
<p class="d-inline ps-1">l.</p>
<p class="d-inline ps-4">Certified copy of OVD or equivalent e-document of OVD or OVD obtained through digital KYC process needs to be submitted (any one of the following OVDs)</p>
</div>
</div>
<div class="row">
<div class="border border-dark col-md-6 ps-4">
<input type="checkbox" name="OVD" class="check d-inline" required>
<h4 class="d-inline">A. Passport Number</h4>
</div>
<div class="border border-dark col-md-6">
<input type="text" class="input form-control border-0" name="ovd">
</div>
</div>
<div class="row">
<div class="border border-dark col-md-6 ps-4">
<input type="checkbox" name="OVD" class="check d-inline" required>
<h4 class="d-inline">B. Voter ID Card</h4>
</div>
<div class="border border-dark col-md-6">
<input type="text" class="input form-control border-0" name="ovd">
</div>
</div>
<div class="row">
<div class="border border-dark col-md-6 ps-4">
<input type="checkbox" name="OVD" class="check d-inline" required>
<h4 class="d-inline">C. Driving Licence</h4>
</div>
<div class="border border-dark col-md-6">
<input type="text" class="input form-control border-0" name="ovd">
</div>
</div>
<input type="submit">
我希望我的表格如果填补了任何字段
I want to make my text field required from a group of text field so that if any one is filled then the form will submit
<div class="row">
<div class="border border-dark d-flex">
<p class="d-inline ps-1">l.</p>
<p class="d-inline ps-4">Certified copy of OVD or equivalent e-document of OVD or OVD obtained through digital KYC process needs to be submitted (any one of the following OVDs)</p>
</div>
</div>
<div class="row">
<div class="border border-dark col-md-6 ps-4">
<input type="checkbox" name="OVD" class="check d-inline" required>
<h4 class="d-inline">A. Passport Number</h4>
</div>
<div class="border border-dark col-md-6">
<input type="text" class="input form-control border-0" name="ovd">
</div>
</div>
<div class="row">
<div class="border border-dark col-md-6 ps-4">
<input type="checkbox" name="OVD" class="check d-inline" required>
<h4 class="d-inline">B. Voter ID Card</h4>
</div>
<div class="border border-dark col-md-6">
<input type="text" class="input form-control border-0" name="ovd">
</div>
</div>
<div class="row">
<div class="border border-dark col-md-6 ps-4">
<input type="checkbox" name="OVD" class="check d-inline" required>
<h4 class="d-inline">C. Driving Licence</h4>
</div>
<div class="border border-dark col-md-6">
<input type="text" class="input form-control border-0" name="ovd">
</div>
</div>
<input type="submit">
i want my form will submit if any of the field filled
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从输入元素中删除“必需”。
您将不再使用 type =“ submit” ,而需要使用
,而是需要创建一些JavaScript函数,以检查是否填充任何输入字段,类似这样的内容:
注意:如果您是初学者,则可以在HTML Element 中添加此代码,但更好的练习是创建外部JS文件,然后调用它。
You can remove "required" from your input elements.
Instead of going with type="submit" , you will need to go with
Now, you will need to create some javascript function that checks if any of the input fields are filled, something like this:
Note: If you are beginner, you can add this code inside of Head HTML element, but better practice is to create an external JS file, and then call it.