Hi all,
I have an input field of type text. characters are inserted into the field via an onscreen number pad.
I would like the width (size) of the text field to expand as characters are inserted. "postalcode" is the id of the text input field in the form "charitiesform".
The following is the function that inserts characters into the field.
function addDigit(key, posPreset){
var key, posPreset, text = document.charitiesform.postalcode;
if(text.value == posPreset) text.value = "";
if(text.value.length < 5){
text.size += + 1;
text.value += key;
return true;
}else{
alert("\tMaximum digits already entered.\r\nPress Clr to enter a new ZIP Code or Del to backspace a digit.");
return false;
}
}
I thought that all i had to do was add the following code snippet, "text.size += + 1;" into the function. Although the value of text.size does increase, the visible width of the text field does increase.
What am i doing wrong?