콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
7373 화면

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
2341
2
7월 17
17175
1
6월 25
597
0
5월 25
780
2
4월 25
2751