2013-06-04 10 views
5

Dalla ricerca su internet, attributo lunghezza massima non funziona su IE 8 e il 9Lunghezza massima del textarea non funziona su IE8

Per risolvere il problema ho cercato una soluzione da qui, esso uso con l'altra funzione che è per la presentazione textarea:

//Dynamic append the textarea row 
function do_resize(textArea) { 
    while (
     textArea.rows > 1 && 
     textArea.scrollHeight < textArea.offsetHeight 
    ) 
    { 
     textArea.rows--; 
    } 
    while (textArea.scrollHeight > textArea.offsetHeight) 
    { 
     textArea.rows++; 
    } 
    textArea.rows++ 
} 


<textarea name="q<%=countNo%>_ans" rows="3" cols="55" maxlength="2000" style="resize: none;" onkeyup="new do_resize(this);" onKeyPress="return (this.value.length < 2000);"></textarea> 

il problema è che la textarea non è in grado di inserire qualsiasi carattere dopo che superi il 2000 a IE8 9, ma ho ancora possibile utilizzare la funzione di copia e incolla che supererà il limite textarea . Come risolvere questo? grazie

+0

scusate. Sembra onpaste = "return false" ha risolto il problema – user1871516

+1

è molto semplice con lunghezza '