[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 116
  • Last Modified:

text boxes

Hello
I want my text boxes to have the same lenght as the database fields and don't let the user to write after that lenght so it doesn't give me the error that I exceed the lenght of the field.
Can you help me?

Thanks
Alberto
0
asimoes
Asked:
asimoes
1 Solution
 
watyCommented:
The first solution
You have to set all your textbox.maxlength to the length of your field :

tbTextbox.MaxLength = Fields(4).FieldSize

The second solution
You can take all the maximum needed left character of your textbox in your record. This will ignore extra characters :

Fields(4).Value = Left(tbTextBox.Text, Fields(4).FieldSize)

NB : Adapt the code for your needs.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now