BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
Forum Home Forum Home >

openElement

> openElement General Discussion
  New Posts New Posts RSS Feed - How to limit length of text input field
  FAQ FAQ  Forum Search   Register Register  Login Login

Topic ClosedHow to limit length of text input field

 Post Reply Post Reply
Author
Message
TC2020 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 Mar 2020
Location: Canada
Status: Offline
Points: 54
Direct Link To This Post Topic: How to limit length of text input field
    Posted: 03 Juil 2021 at 06:55
Hi,

I would like to know how to limit the number of characters in a text input field as well as how to set its width to match the string.

Currently, I define the width of the input field using pixels. I then preview the page, enter some text and count the number of characters. I repeat this process until the width is about right. With this, I can still type in the field and text scrolls to the left. What I would like to achieve is limit this length (say, 24 characters) and the field would stop accepting input after this count. I would like to use this as field validation.

Thank you.
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5718
Direct Link To This Post Posted: 03 Juil 2021 at 12:52
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5718
Direct Link To This Post Posted: 03 Juil 2021 at 13:04
If it is for multi lines text input you will need javascript



Back to Top
TC2020 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 Mar 2020
Location: Canada
Status: Offline
Points: 54
Direct Link To This Post Posted: 04 Juil 2021 at 06:29
Great, thank you.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,031 seconds.