Hey, I was working on a little javascript for my website and I tried some word games. I created a word encrypter, and it works fine. Now I'm working on a script that shows the wordvalue of any entered word, much like the game scrabble. However, my script keeps buggin me with the error that one or more variables aren't defined. The variables mentioned are just a few lines higher, so they are defined. Can anyone tell me what's wrong. I'll attach the entire script and I'll paste the part with the problem.
Oh yeah, and I'm from the netherlands, so some pieces are in dutch.
function woordWaarde()
{
var woordwaardeReeks = document.forms[0].elements[1].value;
var tekst = woordwaardeReeks.toLowerCase();
var waardeKL = 0;
var zoekKL = woordwaardeReeks.match(/[aeiouy]/gi);
var waardeMKL = 0;
var zoekMKL = woordwaardeReeks.match(/[bcdfghjklmnprstvwz]/gi);
var waardeS = 0;
var zoekS = woordwaardeReeks.match(/[xq]/gi);
if (zoekKL)
{
for(var l = 0; l < zoekKL.length; l++)
waardeKL = 1 * zoekKL.length;
} else {
if (zoekMKL)
{
for(var l = 0; l < zoekMKL.length; l++)
waardeMKL = 3 * zoekMKL.length;
} else {
if (zoekS)
{
for(var l = 0; l < zoekS.length; l++)
waardeS = 5 * zoekS.length;
}
}
}
}
Oh yeah, and I'm from the netherlands, so some pieces are in dutch.
function woordWaarde()
{
var woordwaardeReeks = document.forms[0].elements[1].value;
var tekst = woordwaardeReeks.toLowerCase();
var waardeKL = 0;
var zoekKL = woordwaardeReeks.match(/[aeiouy]/gi);
var waardeMKL = 0;
var zoekMKL = woordwaardeReeks.match(/[bcdfghjklmnprstvwz]/gi);
var waardeS = 0;
var zoekS = woordwaardeReeks.match(/[xq]/gi);
if (zoekKL)
{
for(var l = 0; l < zoekKL.length; l++)
waardeKL = 1 * zoekKL.length;
} else {
if (zoekMKL)
{
for(var l = 0; l < zoekMKL.length; l++)
waardeMKL = 3 * zoekMKL.length;
} else {
if (zoekS)
{
for(var l = 0; l < zoekS.length; l++)
waardeS = 5 * zoekS.length;
}
}
}
}