BullGuard Antivirus Sale - 60% Off with openElement !
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: Mar 26 2020
Location: Canada
Status: Offline
Points: 61
Direct Link To This Post Topic: How to limit length of text input field
    Posted: Jul 03 2021 at 5:55am
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: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6209
Direct Link To This Post Posted: Jul 03 2021 at 11:52am
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6209
Direct Link To This Post Posted: Jul 03 2021 at 12:04pm
If it is for multi lines text input you will need javascript



Back to Top
TC2020 View Drop Down
Groupie
Groupie
Avatar

Joined: Mar 26 2020
Location: Canada
Status: Offline
Points: 61
Direct Link To This Post Posted: Jul 04 2021 at 5:29am
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 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.