|
san
|
Microsoft VB Script compilation error '800a03fa' - 'Expected Wend'
Hello,
I am trying to design a web form, whenever I try to run the form I am getting Microsoft Vb Script error.I am using asp and an SQL Server 2005 database.
"I was trying to retrieve data from the database into the dropdown list, I am not sure whether I am doing the right way or not "
If any one can help it will be greatly appreciated.
Microsoft VBScript compilation error '800a03fa'
Expected 'Wend'
Thank you
<%@ LANGUAGE="VBScript" %>
<%
Option Explicit
'Buffer the response, so Response.Expires can be used
Response.Buffer = TRUE
%>
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-t...
<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include virtual="helpdesk/Test/Email_core.asp" -->
<!--#include virtual="/helpdesk/Test/connection.asp" -->
<head>
<title>HelpDesk NewProblem</title>
<script type="text/javascript">
var strAlertMsg = ""
var focusField = ""
//Validate Text Box
function isEmpty(theForm,strFieldName,strMsg){
var objFormField = theForm.elements[strFieldName];
var strValue = objFormField.value;
strValue = strValue.split(" ").join("")
if(strValue.length<1){
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
return true;
}
//==========================================================================
//Validate the Select
function hasSelection(theForm,strFieldName,strMsg) {
var objFormField = theForm.elements[strFieldName];
if(objFormField.selectedIndex ==0) {
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
return true;
}
//========================================================================
//Begin Page Validation
function validateForm(theForm){
strAlertMsg = ""
focusField = ""
hasSelection(theForm,'select1','departmentname')
isEmpty(theForm,'txtBox','NH')
isEmpty(theForm,'txtBox1','SSN')
isEmpty(theForm,'txtBox5','problemTitle')
isEmpty(theForm,'txtBox6','problemDescription')
if(strAlertMsg !=""){
alert("Please correct the following errors:\n____________________________\n\n" + strAlertMsg);
eval("theForm." + focusField + ".focus()");
return false;
}
return true;
}
</script>
<script type="text/javascript">
function enableDefault() {
document.getElementById('representativeSSN').disabled = false;
document.getElementById('organizationName').disabled = false;
document.getElementById('representativeZipCode').disabled = false;
document.getElementById('txtCustomMessage').disabled = true;
}
function enableCustom() {
document.getElementById('representativeSSN').disabled = true;
document.getElementById('organizationName').disabled = true;
document.getElementById('representativeZipCode').disabled = true;
document.getElementById('txtCustomMessage').disabled = false;
}
/**/
//========================================================================
</script>
<script type="text/javascript">
#imageUpload input {
display: block;
}
//this script to upload files
function fileFields() {
var x = document.getElementById('imageUpload');
x.onclick = function() {
var i = parseFloat(this.lastChild.id)+1;
input = document.createElement("input");
input.setAttribute("type", "file");
input.setAttribute("name", 'imageName_' + i);
input.setAttribute("id", i);
this.appendChild(input);
}
}
</script>
</head>
<body>
<!-- <form action="../user/postnew.asp" method="POST">-->
<form id="ContactFormforSOST" action="confirmation.asp" method="post" onsubmit="return validateForm(this);">
<input type="hidden" name="uid" >
<div align="center">
<table class="Wide">
<tr>
<td colspan="2"><div align="right"> <b><em>*</em> - Required</b> </div>
</td>
</tr>
<tr class="Head1">
<td colspan="2" align="center"><b>Contact Form for SOST</b></td>
</tr>
<tr Class="Body1">
<td width="257" valign="top"><div align="center">
<table class="narrow" border="0">
<tr>
<td height="32" colspan="2" align="center"><b>Tell us how to get in touch with you</b> </td>
</tr>
<tr>
<td height="47"><b>UserName:</b> </td>
<td><input type="text" name="userName" size="20" value="<% = userName %>" ><em>*</em></td>
</tr>
<tr>
<td height="35"><b>EMail:</b> </td>
<td><input type="text" name="email" size="20" value="<% = email %>" ><em>*</em></td>
</tr>
<tr>
<td height="38"><b>Location:</b> </td>
<td><input type="text" name="location" size="20" value="<% = location %>"><em>*</em>
</td>
</tr>
<tr>
<td height="40"><b>Phone:</b> </td>
<td><input type="text" name="phone" size="20" value="<% = phone %>"><em>*</em>
</td>
</tr>
</table>
</div>
</td>
<td width="411" valign="top"><div align="center">
<table width="411" height="207" border="0" class="narrow">
<tr>
<td height="27" colspan="2"><div align="center"> <b>Information</b> </div>
</td>
</tr>
<tr>
<td width="134" height="43"><b>
<label id="lbldept" for="select1">Department:</label>
</b> </td>
<td width="267"><SELECT id="select1" NAME="departmentname">
<%
Dim rst
set rst=cnn.Execute ("SELECT * From Departments WHERE DepartmentID > 1 ORDER BY DepartmentName ASC")
if(rst.eof) then
Response.Write("Sorry.... there is no such information ")
rst.Close()
end if
while not rst.eof
%>
<option value="<% = rst("DepartmentID")%>" selected>
<% = rst("DepartmentName") %></OPTION>
</select><em>*</em></td>
</tr>
<tr>
<td height="36"><b>
<label id="lblnh" for="txtBox">NH</label>
</b></td>
<td><input type="text" id="txtBox" name="NH" />
<em>*</em> </td>
</tr>
<tr>
<td height="44"><b>
<label id="lblssn" for="txtBox1">SSN:</label>
</b> </td>
<td><input type="text" id="txtBox1" name="SSN" />
<em>*</em> </td>
</tr>
<tr>
<td height="45"><b>
<label id="lblssn" for="txtBox1">Attachments:</label>
</b> </td>
<td height="45" colspan="2"><input type="hidden" size="35" name="attach1" value="100" />
<input name="file" type="file" />
<br>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr class="Head2">
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><div align="left"> <b>IsRepresentativePayeeInvolved?</b> <em>*</em> </div>
</td>
</tr>
<tr>
<td><b>Yes:</b>
<input type="radio" name="rbMsgSource" value="01" onclick="enableDefault()">
<b>No:</b>
<input type="radio" name="rbMsgSource" value="02" checked="checked" onclick="enableCustom()">
</td>
</tr>
<tr class="Body1">
<tr>
<td><b>Reppayeessn:</b> </td>
<td><input name="representativeSSN" disabled size="10" value="Enter SSN" type="text" onfocus="if(this.value=='Enter SSN'){this.value='';}" onblur="if(this.value==''){this.value='Enter SSN';}">
<em>*</em> </td>
</tr>
<tr>
<td><b>ZipCode:</b> </td>
<td><input name="representativeZipCode" disabled size="20" value="Enter ZipCode" type="text" onfocus="if(this.value=='Enter ZipCode'){this.value='';}" onblur="if(this.value==''){this.value='Enter ZipCode';}">
<em>*</em> </td>
</tr>
<tr>
<td><b>orgainizationname:</b> </td>
<td><input name="organizationName" disabled size="50" value="Enter Organization Name" type="text" onfocus="if(this.value=='Enter Organization Name'){this.value='';}" onblur="if(this.value==''){this.value='Enter Organization Name';}">
<em>*</em><br />
</td>
</tr>
</tr>
<tr class="Body1">
<tr>
<td colspan="2"><div align="left"> <b>
<label id="lblRadio" for="isProblemQuestion">What kind of issue do you have?:</label>
</b> <em>*</em></div></td>
</tr>
<tr>
<td><input type="radio" id="radio1" name="isProblemQuestion" checked="checked" value="01" />
<b>Problem/Question</b> </td>
<td><input type="radio" name="isProblemQuestion" value="02" />
<b>Comment</b> </td>
</tr>
<td colspan="2"><b>
<label id="lbltitle" for="txtBox5">Subject</label>
</b> <em>*</em><br>
<input type="text" size="50" id="txtBox5" name="problemTitle" />
<p> <b>
<label id="lblDesc" for="txtBox6">Enter your question or issue below: :</label>
</b> <em>*</em><br />
<textarea cols="80" rows="12" id="txtBox6" name="problemDescription"></textarea>
</td>
</tr>
<tr class="Head2">
<td colspan="2"><div align="center">
<input type="submit" id="btnSubmit" name="btnSubmit" value="SubmitTicket">
<input type="reset" id="btnReset" name="btnReset" value="ClearForm">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|