formname.fieldname.value is not a valid......

wxdqz

New Member
I posted a previous post about a scrabble style script that calculates the word value. I already got the problem I stumbled upon that time, but now I keep getting other error messages.

I create a html form that you fill out. After that my JS uses a new screen (not a new window, just a new screen. can't really explain what I mean, try it for yourself) and can't use the info from the form. Any idea how to run this script without problems?

And I tried using cookies before, but due to the fact that I stink at cookies and that not everyone uses them, I decided not to use them.

Here's the script;

<html>
<head>
<title> Jeffrey Hendriks CSV1B
</title>
<head>
<body>
<form name = "Invoer">
<input type = "text" name = "versleutel"> Voer een woord in, dit woord zal worden versleuteld.<br>
<input type = "text" name = "woordwaarde"> Voer een woord in, hiervan zal de woordwaarde worden uitgerekend.<br>
<INPUT TYPE="button" VALUE=http://www.webdeveloper.com/forum/archive/index.php/"Query uitvoeren" NAME="startCheck" onClick="encrypt()">
<INPUT TYPE="reset" VALUE="Leeg maken" NAME="maakLeeg">
</FORM>
<script language="javascript">

<!--

function encrypt()
{
var codeerReeks = Invoer.versleutel.value;
var t = 0;
var teller = 1;
var begin = codeerReeks.length + 1;
var char = 0;
var ascii = new Array(codeerReeks.length);

do
{
char = codeerReeks.charCodeAt(t) + teller;
ascii[t]=char;
t++;
teller++;
}
while (teller < begin)

var t = 0;
var teller = 1;
var begin = codeerReeks.length + 1;

do
{
document.write(String.fromCharCode(ascii[t]));
t++;
teller++;
}
while (teller < begin)
woordWaarde()
}

function woordWaarde()
{

var woordwaardeReeks = Invoer.woordwaarde.value;
var text = woordwaardeReeks.toLowerCase();
var waardeKL = 0;
var zoekKL = woordwaardeReeks.match(/[aeijouy]/gi);
var waardeMKL = 0;
var zoekMKL = woordwaardeReeks.match(/[bcdfghklmnprstvwz]/gi);
var waardeS = 0;
var zoekS = woordwaardeReeks.match(/[xq]/gi);

if(zoekKL)
{
for(var l = 0; l < zoekKL.length; l++)
waardeKL = 1 * zoekKL.length;
}

if(zoekMKL)
{
for(var l = 0; l < zoekMKL.length; l++)
waardeMKL = 3 * zoekMKL.length;
}

if(zoekS)
{
for(var l = 0; l < zoekS.length; l++)
waardeS = 5 * zoekS.length;
}

var totaal = waardeKL + waardeMKL + waardeS;
document.write(totaal)
}

//eind verbergen javascript -->
</script>
</body>
</html>

I really hope someone can help me, because this isn't my first time encountering this problem. I could never solve these problems, I just made a different script (or no script at all). But I know I shouldn't let such a stupid problem get in my way, so help would be appreciated.

EDIT: I changed the naam="woordwaarde" to name="woordwaarde" . It doesn't seem to help though....
 
Back
Top