In certain situations (classified ad, page description, security), you may want to limit the amount of text that can be put into a textarea form field. For regular input tags, you can use the maxlength attribute, but the textarea tag has no such built-in limit specifier.
Today I'll show you how to implement something that appears easy at first glance but can be a bit tricky. It is the "label within the form field" functionality seen in forms that must take up very little space on a web page.
You may have encountered web pages where an action on your part (like clicking a link or checking a checkbox or moving the mouse over a certain part of the web page) inserted causes additional content to appear on the page. The web site may have made it possible for another action to remove the content.
This technique is commonly used on professional order forms. It lets customers click something to automatically fill in shipping information without retyping identical information already provided in billing form fields. Or vice versa.
Let's suppose you want to provide your site visitors the option of automatically causing a new browser window to open whenever they click on a link -- by simply checking one checkbox.