How to only allow numbers to be entered in text box?

Creating and using forms
Post Reply
cleavec
Posts: 1
Joined: Tue Jun 20, 2017 6:23 pm

How to only allow numbers to be entered in text box?

Post by cleavec »

I'm creating a data entry form and want to limit users to only be able to enter numbers into a certain field (barcode).

I don't need a message to come up telling the user that they're only allowed to enter numbers, I just want nothing to happen when they press anything other than a number key.

As a bonus, is there a way to stop input, as with the first question, after the user has typed in 5 digits?
OpenOffice 4.1.3 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to only allow numbers to be entered in text box?

Post by Villeroy »

viewtopic.php?f=13&t=88873&p=418327&hil ... ld#p418314

Look up "edit mask" and "literal mask" in the F1-help.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
zark
Posts: 4
Joined: Wed Jul 26, 2017 3:13 pm

Re: How to only allow numbers to be entered in text box?

Post by zark »

i would;

edit/form navigator/ 'choose your field' -- replace with formatted field
properties of formatted field ... VALUE MAX == 99999 .. so it rejects 100000 or more and
formatting [...] -- change to Number , remove decimal places -- it will reject letters when next field is click onto

its basic, so i would prob attach a note to the field for the user
OpenOffice 4.1.3 on WINDOWS 7, sp1, 64bit
Post Reply