Get form is undefined error when trying to submit this form to the CGI-BIN. Basically there is a lot of validation going on to make sure they selected a type from the dropdown box and if that type requires a property # then make sure one is entered and it is a 6 digit numeric. There are two buttons on this form, the open letter one (which i am attaching the call to the first validating function) and the search button. Not sure why this error is occurring, just need this form to get submitted! Here is the code:
<HTML>
<HEAD>
<TITLE></TITLE>
<LINK REL=stylesheet HREF="/YonB.css">
</HEAD>
<script type="text/javascript">
function NameSearch(sSearch) {
var sLink = "//domain/cgi-bin/nmarwi40
?sSearch="
+ sSearch + "&nFilter=3";
if (sSearch.length < 1) {
alert("Enter a string to search for.");
return "000000";
}
else {
for (i = 0; i < sSearch.length; i++) {
if (sSearch.charAt(i) == " ") {
alert("Search string must not contain spaces.");
return "000000";
}
}
return showModalDialog(sLink);
}
}
function doFirst(SelectedValue, PropNum){
if (SelectedValue == 00) {
alert("Please select a type of letter.");
}
//if the letter type requires a property number
else if (SelectedValue == 04 || SelectedValue == 05 || SelectedValue == 09 || SelectedValue == 11 ||
SelectedValue == 13 || SelectedValue == 14 || SelectedValue == 15 || SelectedValue == 19 ||
SelectedValue == 20) {
if (PropNum.length < 1) {
alert("You must enter a property number for that letter type.");
}
else { //Check to make sure the property number is valid
ValProperty(PropNum);
}
}
else {
return 00;
}
}
//
function ValProperty(value) {
if (value.length != 6 || isNaN(parseInt(value))) {
alert("Enter a 6-digit number for property or use the search function to find the property number.");
return false;
}
else {
form.submit(view) ////////submit the form since everything has been validated
}
}
//Submit form if input fields are valid
function SubmitView(form) {
if (ValProperty(form.PRPRTY.v
alue)) {
alert("Made it to SubmitForm.");
form.submit()
}
}
function sbmview() {
PgmName = View.PgmName.value;
SubmitView(View);
}
function valLetter(sSearch, sFilter){
alert("Var1: " + sSearch + " sFilter: " + sFilter);
}
</script>
<BODY BGCOLOR=rgb(255,255,196) TEXT="BLUE">
<p><br>
</p>
<H1>Mail Merge</H1>
Owner No. <BR>
<FORM ACTION="cgi-bin/sysroi" METHOD="GET" NAME="View">
<INPUT TYPE="hidden" NAME="PgmName" VALUE="NMARWI">
<INPUT TYPE="hidden" NAME="Owner" VALUE="">
<INPUT TYPE="hidden" NAME="User" VALUE=""><small>
<B><table border="0">
<tbody>
<tr>
<td height="69" width="236"><small><b><br>
Select a Template:
</b></small><br><select name="nFilter" size="1">
<option value="00"></option>
<option value="01">60 Day Letter - Escheat</option>
<option value="02">60 Day Letter - Executed Division Order</option>
<option value="03">60 Day Letter - Title Request</option>
<option value="04">60 Day Letter - Unknown Address</option>
<option value="05">Change of Address</option>
<option value="06">Electronic Funds Transfer Rejection</option>
<option value="07">Locate Owners</option>
<option value="08">OK - Affidavit of Heirship</option>
<option value="09">OK - Death Letter</option>
<option value="10">Request - Add Others to Account</option>
<option value="11">Request - Both Joint Tenants Sign</option>
<option value="12">Request - Death Certificate</option>
<option value="13">Request - Recorded Documents</option>
<option value="14">Request - Social Security/Tax ID Number</option>
<option value="15">Request - Trustee Documents</option>
<option value="16">Social Security/Tax ID Number
Verification</option>
<option value="17">Transfer - Individual to Trust</option>
<option value="18">TX - Affidavit of Heirship</option>
<option value="19">TX - Death Letter</option>
<option value="20">Withhold Payment</option>
</select></td>
<td height="69" width="41"><small><b></b><
/small></t
d>
<td height="69" width="110"><small><b><br>
Enter Property #:</b></small><br>
<small><b><small><small><b
></b></sma
ll></small
></b></sma
ll><input type="text" name="PRPRTY" size="5" maxlength="6"">
</td>
<td height="69" width="33">
</td>
<td height="69" width="136">or Enter a string to search for Property #:<br>
<input type="text" name="sSearch" size="15"></td>
<td height="69" width="358"><br>
<br>
<input type="button" value="Search"
onclick="View.Owner.value=
NameSearch
(sSearch.v
alue);"
id="button1" name="button1"></td>
</tr>
<tr>
<td width="236" height="37"><input type="button" value=" Open Letter " onclick="doFirst(nFilter.v
alue, PRPRTY.value);SubmitView(v
iew)"></td
>
<td width="41" height="37"></td>
<td height="37" width="110"></td>
<td height="37" colspan="2"></td>
<td height="37" width="358"></td>
</tr>
</tbody>
</table></Form>
<P><BR> </p>
</BODY>
</HTML>
Start Free Trial