TextBox Expander
Written by admin on December 26, 2008 – 6:40 am -I get annoyed when I’m trying to fill in a form and I have to scroll left or right to see what I’ve typed.This little script puts an end to that. The amazing expanding text box!
Author: Michael P. Hemmes (trueluck3@hotmail.com )
<!-- TWO STEPS TO INSTALL TEXTBOX EXPANDER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<script>
// The following script was written by: Michael P. Hemmes (trueluck3@hotmail.com)
// This script is freeware. You may use it, change it, add to it.
// I don't even care if you give me credit or not (I do, however, appreciate credit)
// However, DO NOT change this script and leave my name credited to the changed script.
function boxexpand()
{
// Code to make the script easier to use //
boxValue=document.all.thebox.value.length
boxSize=document.all.thebox.size
minNum=20 // Set this to the MINIMUM size you want your box to be.
maxNum=100 // Set this to the MAXIMUM size you want your box to be.
// Starts the main portion of the script //
if (boxValue > maxNum)
{
}
else
{
if (boxValue > minNum)
{
document.all.thebox.size = boxValue
}
else if (boxValue < minNum || boxValue != minNum)
{
document.all.thebox.size = minNum
}
}
}
// End of script //
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form method="POST" action="_vti_bin/shtml.dll/expand.htm" webbot-action="--WEBBOT-SELF--">
<p><input type="text" onKeypress="boxexpand()" name="thebox" size=20><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<!-- Script Size: 2.16 KB -->
Tags: form
Posted in Forms |