FAQ: Learn HTML: Form Validation - Checking Text Length

This community-built FAQ covers the “Checking Text Length” exercise from the lesson “Learn HTML: Form Validation”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Introduction to HTML

FAQs on the exercise Checking Text Length

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

4 posts were split to a new topic: Where is data on a website stored?

2 posts were split to a new topic: For the method attribute what are the differences between POST and GET?

Easter egg? ilovecoding

Poking around, I noticed on the login.js that a message will appear (or should) when one enters a username of “codecademy” and a pw of “ilovecoding” however mine did not…

SOOO… what would I need to do to make the exercise index.html run this particular portion of JS (easter egg? :egg::sunflower surprise!)?

Not sure what the problem might be from just that. Mine worked.

I , i’ve been learning here for a while now, and i’m curious where these related stylesheet are from?like this one link href=“https://fonts.googleapis.com/css?family=Fjalla+One” rel=“stylesheet” are they downloaded from google or what?

google has a whole bunch apis and CDNs you can use, these files are fetched from the internet. Although, no doubt some caching is happening

2 posts were split to a new topic: Whats the difference between max and maxlength?

4 posts were split to a new topic: Where is the code that interprets the form submission?

A slight tangent to the exercise here, but in the element, there is a class=“overlay” attribute. What does this do?

Just FYI, in case it’s not been pointed out, the example code in the label says “Summarize your fillings.” Fine if this is for a dentist’s website… but I assume you meant “feelings.”

In this exercise: https://www.codecademy.com/courses/learn-html/lessons/html-form-validation/exercises/minlength-maxlength
can the min/max or minlength/maxlength be used in the <textarea> element?

Sounds like a question you could consult documentation on:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea

I see the attributes in the docs, which means you can use them

I noticed that after setting the maxlegth attribute, I’m actually not able to type in more characters than specified by the attribute (rather than having to submit a too-long string an seeing the error message). Is this also default behavior implemented by the browser? Else, what code does this/how?

Yes, the behavior you described is indeed the default behavior implemented by most modern web browsers. When you set the maxlength attribute on an input element in HTML, the browser automatically enforces that limit by preventing the user from typing more characters than the specified limit.

This behavior is handled by the browser itself and doesn’t require any additional code on the developer’s part. When the user reaches the maximum character limit while typing in an input field, further keystrokes are simply ignored by the browser.