Magento Checkout 页面上的表单字段验证是如何发生的

How does form field validation occur on a Magento Checkout page

我无法弄清楚是什么触发了 Magento Checkout 页面上的表单验证。 Magento 2.4,PHP 7.4

在选择运输方式的单选按钮时,它会自动在剩余的输入字段上显示必填字段验证。

The following picture shows the required field validation that occurs on the input fields on toggling between radio buttons

我一直在代码中搜索验证的来源。截至目前,我找到了一个文件 'default-validator.js',它可能是被触发的文件,但我无法找到对该文件的任何引用,因此不确定从何处触发验证。我确实认为这可能是默认验证,但我检查了所有涉及的表单标签都启用了 novalidate,这意味着默认验证已关闭。

The following image shows the content of defaut-validator.js

试着看看这个布局文件,有很多使用它的例子。希望这会为您提供所需的起点,只需搜索验证即可:

vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml