Hi, I have two forms (different actions) on a page which work perfectly but when I change one form field making it into two fields (I want the form to go horizontally across the page and not vertically) it returns an error - var itemA = parseInt(form1.words.value); is null or not an object.

Below is the my script. Is it possible to have more than one field for a form and have another different form as well?

Greatly appreciated to anyone who can help me out.


<head>
<script language="javascript">
function workit()
{
var xsource = new Array(0,0.00,0.00); // source language
var xtarget = new Array(0,0.09,0.1); // target language
var xtype = new Array(0,0); // type of text
var itemA = parseInt(form1.words.value);
if(!itemA){itemA=1};
var itemB = parseInt(form1.source.options[form1.source.selectedIndex].value);
var itemC = parseInt(form1.target.options[form1.target.selectedIndex].value);
var itemD = parseInt(form1.type.options[form1.type.selectedIndex].value);

var total = (itemA*(xtarget[itemC]+xtype[itemD]));
//var total = itemA;
mytotal.innerHTML = total.toFixed(2);
}
function validate() {
if (document.form2.yourname.value.length < 1) {
alert("Please enter your name.");
return false;
}
if (document.form2.youremail.value.length < 5) {
alert("Please check your email address is correct.");
return false;
}
if (document.form2.select4.value.length < 1) {
alert("Please choose a source language.");
return false;
}
if (document.form2.select5.value.length < 1) {
alert("Please choose a target language.");
return false;
}
return true;
}
</script>
</head>

<body>
<font color="#BEB541" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Total
Cost: &pound;<span id="mytotal"></span></b></font>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="5" rowspan="3" valign="top">
<form name="form1">
<font color="#BEB541" size="1" face="Verdana, Arial, Helvetica, sans-serif">Number
of Words:</font><br>
<input TYPE="TEXT" SIZE="20" NAME="words" value="" onChange="workit()">
</p>
<p><font color="#BEB541" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Source
Language:</strong></font><br>
<select NAME="source" id="source" onChange="workit()">
<option VALUE="0" SELECTED>Select Language >
<option VALUE="1">English</option>
<option VALUE="1">Albanian</option>
</select>
</p>
</form>
&nbsp;</td>
<td colspan="3" rowspan="2" valign="top"><form name = "form1">
<p><font color="#BEB541" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Target
Language:</strong></font><br>
<select NAME="target" onChange="workit()">
<option VALUE="0" SELECTED>Select Language >
<option VALUE="1">English</option>
<option VALUE="1">Albanian</option>

</select>
<p><font color="#BEB541" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Text
Type:</strong></font><br>
<select NAME="type" onChange="workit()">
<option VALUE="1">Business/Financial</option>
</select>
</form>
<form name="form2" action="formmail.cgi" enctype="text/plain" method="POST" onSubmit="return validate();">
<blockquote>
<p><font color="#BEB541" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Name:
</strong></font><br>
<input TYPE="TEXT" SIZE="30" NAME="yourname">............................................................