Today i made a question and i tried to make some advices of experts on javascript, however my code it is still failing. Im going to try to give more information with the purpose to solve my problem. Im new on javascript and im completely sure that this will piece of cake for some people. This is my problem with my code. Im going to try to give all info as soon as possible.
I have this jsp with this textarea:
<form:textarea id="textEnv" path="buscadorReferenciaE" onkeyup="comprobarTexto();"
cssStyle="vertical-align: middle; margin-left:1px; width: 263px; height: 220px;" />
In this code as you can see a user enter string, and is involved in the onkeyup:
And this is my function on javascript:
function comprobarTexto(){
var texto = document.getElementById('textEnv').value;
if (texto.length > 14) {
texto= "";
}
}
The purpose of this function is that when the user reaches 14 characters the text on the texfield must be REMOVED COMPLETELY, however despite advices of experts my code still failing and the function doesnt work. Its very probably that is my fault, but im still not seeing how to resolve this. I give more information on the last question that i made:
It must be the function in javascript, that is not working, no more code of my jsp is involved. When the characthers reaches to 14 the function warn me with an alert(now is removed but it works) I will try tomorrow to solve this, with your help. Thanks for your help as always.