This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear visitors,
This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.
We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.
At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.
Thank you for understanding.
Script Title: maxLength
Programming Language: JavaScript
Date Completed: 2012/09/24
Purpose: To restrict or force a Web browser to restrict the maximum input length for a field.
Description: Not all Web browsers can restrict the text length limit of an input field. This JavaScript class can force virtually all Web browsers to restrict the input size.
Compatibility: Works with all Web browsers.
Special Note: Does not work with Opera 6 and older.
Methods:
var class = new maxLength();
class.targetId;Assign limit to element ID
class.max;Assign the max character limit
class.length;Returns the current number of characters
class.start();Function to start the listeners
class.stop();Function to stop the listeners
Max:
Default value 0 if HTML attribute maxlength is not set or if the Web browser does not support reading HTML attributes. Set this value if you feel your Website visitors maybe using legacy Web browsers or you have not set the maxlength attribute.
If the max value is set higher than the maxlength attribute, the maxlength attribute will be set to match. However, if the maxlength attribute is not set, it will be set with the max value.
Example Usage:
HTML
<textarea id=”mytxtArea” rows=”4″ cols=”30″ maxlength = “16”></textarea>
Java Script
var textBox1 = new maxLength();
textBox1.targetId = “mytxtArea”;
textBox1.start();
Terms of Use, Cookies, Privacy, and more, see Terms and Privacy
Third-party copyrights and trademarks featured on this site are owned by their respected holders.
Website written and designed by Patcoola 2019, some rights reserved.
This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear EU visitor, I am required to ask you consent for the following.