跳至内容
菜单
此问题已终结
1 回复
7763 查看

Hello,

I am trying to create a integer field for entering phone numbers and I want to add a validation so that it would not allow to save the value if
it exceeds 10 digits. The optional size parameter seems to have no effect. How can I achieve this?

Thank You.

形象
丢弃
最佳答案

Simplest way I think would be to use an onchange-method on the field. If the value is > 10, clear the field and display a message.

The docs mention this:

on_change:

Default value for the on_change attribute in the view. This will launch a function on the server when the field changes in the client. For example, on_change="onchange_shop_id(shop_id)".

形象
丢弃
相关帖文 回复 查看 活动
0
8月 19
2611
2
7月 17
17726
2
8月 25
2795
1
7月 25
1132
1
8月 25
1152