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

Creating and using forms

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

Postby cleavec » Tue Jun 20, 2017 6:31 pm

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
cleavec
 
Posts: 1
Joined: Tue Jun 20, 2017 6:23 pm

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

Postby Villeroy » Wed Jun 21, 2017 2:18 pm

https://forum.openoffice.org/en/forum/v ... 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 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24656
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Postby zark » Wed Jul 26, 2017 4:20 pm

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
zark
 
Posts: 4
Joined: Wed Jul 26, 2017 3:13 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 6 guests