Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
7638 Переглядів

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)".

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
серп. 19
2534
2
лип. 17
17555
2
серп. 25
2391
1
лип. 25
893
1
серп. 25
1151