How to override Symfony form MoneyType input as type=“number”?

前端 未结 4 874
天命终不由人
天命终不由人 2021-01-18 09:54

The Symfony MoneyType Field renders as input type=\"text\" which allows a user to type whatever they want into the field.

How can I override this to ren

4条回答
  •  悲哀的现实
    2021-01-18 10:40

    I had the same issue. When I enter a string in a Money Type field, I had a php "number parsing failed" message.

    To solve this I modified intl.error_level value in my php.ini file to 0. You can also comment the line.

    No php error anymore. If I enter a string the error is handled by Symfony and I just get the message "This value is not valid" displayed under my input. So no need to override the input type="text"!

提交回复
热议问题