I want to make a backgroundcolor changer. I only put in numbers until now with “mouseclick”. As the charecters used for colors are 5 i want the max of clicks to be 5. I have to put in a counter or check the length of the number… Don’t know how.
The function can only be used 5 times and then i want another function to start..
here is what i got, now it puts all the numbers 6 times, but that is not what i want. I the user to only be able to put in 6 numbers an than auto. start another function
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language=”javascript”>
function teller(nummer) {
var getal
for (i=0;i<7;i++)
{
getal=document.kleurennummer.tekstveld.value;
document.kleurennummer.tekstveld.value=getal+nummer;
}
}
</script>
</HEAD>
<BODY>
<form name=”kleurennummer”>
<font color=”blue”>
<table border=2 cellspacing=0 bordercolor=”blue” bgcolor=”yellow” face=”blue” >
<tr >
<td width=20 height=20 onClick=”teller(‘1’)”>
<center><font color=”blue”>1</font></center>
</td>
<td width=20 height=20 onClick=”teller(‘2’)”>
<center><font color=”blue”>2</font></center>
</td>
<td width=20 height=20 onClick=”teller(‘3’)”>
<center><font color=”blue”>3</font></center>
</td>
<td width=20 height=20 onClick=”teller(‘4’)”>
<center><font color=”blue”>4</font></center>
</td>
<td width=20 height=20 onClick=”teller(‘5’)”>
<center><font color=”blue”>5</font></center>
</td>
<td width=20 height=20 onClick=”teller(‘6’)”>
<center><font color=”blue”>6</font></center>
</td>
<td width=20 height=20 onClick=”teller(‘7’)”>
<center><font color=”blue”>7</font></center>
</td>
</tr>
</table>
<form name=”kleurennummer”>
<input type=”text” name=”tekstveld” size=”25″>
</form>
</font>
</BODY>
</HTML>