Limit a (inline) input to 4 digits

QuestionsLimit a (inline) input to 4 digits
Stan asked 7 years ago

Hi Abu

I have 2 Questions

1. I have a 4-digits code coloumn in my record, and I want to limit the input to exactely 4 digits, when adding a new record. I don't see a specific limit command, how can i now peform this check ?

2. Is the serverside validation only avaiable in the popup mode ?
I'd like to avoid the popup mode and prefer the inline add method.

Thanks for any help

1 Answers
Abu Ghufran answered 7 years ago

#1, Use html standard way:
$col["editoptions"]["maxlength"] = "4";

You can also use masked input plugin:
http://phpgrid.org/faqs -> How to mask a field, for example like this: (NN) NNNN-NNNN ? N stands for number.

#2, Server side validation applies on inline add as well and prompt error message.

Your Answer

6 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?