-2

I am making a registration form and I want the entry to have a minimum of 5 characters so that it can be saved in the database, and I also want it to have a limit of 12, so that when the limit is reached, the entry does not let me write more

NOTE: I am making the form in structured code, I do not put the code because they are only entries, I want to see how the functions that have to be done would be

  • 1
    Does this answer your question? [Restricting the value in Tkinter Entry widget](https://stackoverflow.com/questions/8959815/restricting-the-value-in-tkinter-entry-widget) – Alexander Oct 04 '22 at 18:20

1 Answers1

1

If you're using django you can write a custom validator for that modelfield

Below is a link to the django doc on writing custom validators

https://docs.djangoproject.com/en/4.1/ref/validators/

If you using flask

read this docs https://wtforms.readthedocs.io/en/2.3.x/validators/

I hope this is helpful