Hello all,
I've found an script on the internet witch autocompletes words from an array.
This only works for the first line in a textarea.
the question is how can i make it work on multiple lines???
Here is the script
tnx TanTrazz
I've found an script on the internet witch autocompletes words from an array.
This only works for the first line in a textarea.
the question is how can i make it work on multiple lines???
Here is the script
Code:
<script LANGUAGE="JavaScript" type="text/javascript" type="text/javascript">
<!--
autoComplete=new Array("Computer opnieuw geïnstalleerd","Spyware verwijderd","Viruscontrole uitgevoerd", "Computer opgehaald","Hardware geïnstalleerd", "Software opnieuw geïnstalleerd","Exchange", "Microsoft", "Microsoft Windows", "Microsoft Word", "Microsoft Excel", "Microsoft Publisher");
function komplett(feld) {
if (!self.event || String.fromCharCode(event.keyCode).search(/[\w\-0-9\.\,]/)==-1) return;
sname=feld.value.toLowerCase();
for (i=0;i<autoComplete.length;i++) {
if (autoComplete[i].toLowerCase().indexOf(sname)==0 && sname.length!=autoComplete[i].length) {
feld.value=autoComplete[i];
(range=feld.createTextRange()).moveStart("character",sname.length);
range.select();
break;
}
}
}
// -->
</script>
tnx TanTrazz