- 本文地址: https://www.yangdx.com/2025/06/252.html
- 转载请注明出处
Dcat 金额输入框 $form->currency('price')
,当输入的值比较大时,会自动加上千分位逗号,提交到后台可能导致一些验证码规则执行错误。
我们可以在 bootstrap.php 里面加入下面的代码,让表单在提交前自动去掉千分位逗号:
// 金额输入组件提交的时候自动去掉逗号
Form\Field\Currency::resolving(function (Form\Field\Currency $currency) {
$currency->options(['autoUnmask' => true]);
});
快来评论一下吧!
发表评论