Solved

Microsoft JScript compilation (0x800A03EC) Expected ';'

Posted on 2003-12-05
17
2,542 Views
Last Modified: 2012-06-27
Hi guys,
im getting this error message
Microsoft JScript compilation (0x800A03EC)
Expected ';'
submit.asp, line 70, column 3

here is my code, anyone any ideas how to fix? line 70 is the first line.

<%

 If request.form("NAME")="" then
Response.Write "<table width=""448"" border=""0"" cellspacing=""0"" cellpadding=""0"" background=""../images/c_icbox.gif"" height=""365"" align=""center"">"
Response.Write "  <tr> "
Response.Write "    <td>"
Response.Write "      <div align=""center""><img src=""images/c_ic_deny.gif""><br>"
Response.Write "        <font face='verdana' size=2><b>!!! ERROR !!!</b><br>"
Response.Write "        <b>Please Go Back & Check That You Have Filled In <br>"
Response.Write "        All The Required Feilds</b></font><br>"
Response.Write "        <a href=""Javascript:history.back();""><<< Back</a></div>"
Response.Write "    </td>"
Response.Write "  </tr>"
Response.Write "</table>"
Response.Write ""

else

    for i=1 to request.form.count
   Message = Message & request.form.key(i) & " : " & request.form.item(i) & vbCrLf
    Next
      
    Set objMail = CreateObject("CDONTS.Newmail")
    objMail.From = request.form("Email")
    objMail.To = "myemail@mydomain.com"
    objMail.Subject = "- My Form - "
    objMail.Body = Message
    objMail.Send
    Set objMail = Nothing

      Response.Redirect("itWorked.asp")

End If
%>  
0
Comment
Question by:jay_eire
  • 12
  • 5
17 Comments
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
It sounds like the default server side scripting language on your server is Jscript.  Try changing that in IIS or put this at the top of your page.

<%@ Language=VBScript %>
0
 
LVL 7

Author Comment

by:jay_eire
Comment Utility
thanks for that but im using JScript else where on the page in menu etc,,,

do i have to add in ; to the end of the lines?
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
You have to convert the code above the jscript.  It currently is in VBScript.  It's more than just ; at the end.
0
 
LVL 7

Author Comment

by:jay_eire
Comment Utility
Do you have any pointers on what has to change?
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
Try this
if(Request.Form("NAME")==""){
      Response.Write("<table width=""448"" border=""0"" cellspacing=""0"" cellpadding=""0"" background=""../images/c_icbox.gif"" height=""365"" align=""center"">");
      Response.Write("  <tr> ");
      Response.Write("    <td>");
      Response.Write("      <div align=""center""><img src=""images/c_ic_deny.gif""><br>");
      Response.Write("        <font face='verdana' size=2><b>!!! ERROR !!!</b><br>");
      Response.Write("        <b>Please Go Back & Check That You Have Filled In <br>");
      Response.Write("        All The Required Feilds</b></font><br>");
      Response.Write("        <a href=""Javascript:history.back();""><<< Back</a></div>");
      Response.Write("    </td>");
      Response.Write("  </tr>");
      Response.Write("</table>");
      Response.Write("");
}
else {
    var Message, Key;
    for (Key in Request.Form) {
            Message += Key + " : " & request.Form.Item(Key) & vbCrLf;
    }
     
    var objMail = Server.CreateObject("CDONTS.Newmail");
    objMail.From = request.form("Email");
    objMail.To = "myemail@mydomain.com";
    objMail.Subject = "- My Form - ";
    objMail.Body = Message;
    objMail.Send;
    Response.Redirect("itWorked.asp");
}
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
on small change

if(Request.Form("NAME")==""){
     Response.Write("<table width=""448"" border=""0"" cellspacing=""0"" cellpadding=""0"" background=""../images/c_icbox.gif"" height=""365"" align=""center"">");
     Response.Write("  <tr> ");
     Response.Write("    <td>");
     Response.Write("      <div align=""center""><img src=""images/c_ic_deny.gif""><br>");
     Response.Write("        <font face='verdana' size=2><b>!!! ERROR !!!</b><br>");
     Response.Write("        <b>Please Go Back & Check That You Have Filled In <br>");
     Response.Write("        All The Required Feilds</b></font><br>");
     Response.Write("        <a href=""Javascript:history.back();""><<< Back</a></div>");
     Response.Write("    </td>");
     Response.Write("  </tr>");
     Response.Write("</table>");
     Response.Write("");
}
else {
    var Message, Key;
    for (Key in Request.Form) {
          Message += Key + " : " & request.Form.Item(Key) + vbCrLf;
    }
     
    var objMail = Server.CreateObject("CDONTS.Newmail");
    objMail.From = request.form("Email");
    objMail.To = "myemail@mydomain.com";
    objMail.Subject = "- My Form - ";
    objMail.Body = Message;
    objMail.Send;
    Response.Redirect("itWorked.asp");
}
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
Sorry there's still a small change again.....replace & for concatenation with +
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
I'm not sure if vbcrlf will work in jscript.  I will take a look
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
This should do it.

if(Request.Form("NAME")==""){
      Response.Write("<table width=""448"" border=""0"" cellspacing=""0"" cellpadding=""0"" background=""../images/c_icbox.gif"" height=""365"" align=""center"">");
      Response.Write("  <tr> ");
      Response.Write("    <td>");
      Response.Write("      <div align=""center""><img src=""images/c_ic_deny.gif""><br>");
      Response.Write("        <font face='verdana' size=2><b>!!! ERROR !!!</b><br>");
      Response.Write("        <b>Please Go Back & Check That You Have Filled In <br>");
      Response.Write("        All The Required Feilds</b></font><br>");
      Response.Write("        <a href=""Javascript:history.back();""><<< Back</a></div>");
      Response.Write("    </td>");
      Response.Write("  </tr>");
      Response.Write("</table>");
      Response.Write("");
}
else {
    var Message, Key;
    for (Key in Request.Form) {
      Message += Key + " : " + request.Form.Item(Key) + String.fromCharCode(13,10);
    }
     
    var objMail = Server.CreateObject("CDONTS.Newmail");
    objMail.From = request.form("Email");
    objMail.To = "myemail@mydomain.com";
    objMail.Subject = "- My Form - ";
    objMail.Body = Message;
    objMail.Send;
    Response.Redirect("itWorked.asp");
}
0
 
LVL 7

Author Comment

by:jay_eire
Comment Utility
thank you for your help on this....

but it has an error message

Error Type:
Microsoft JScript compilation (0x800A03EE)
Expected ')'


line 69, column 30

which is

Response.Write("<table width=""448"" border=""0"" cellspacing=""0"" cellpadding=""0"" background=""../images/c_icbox.gif"" height=""365"" align=""center"">");
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
I just tested this one.  It should work for you.

<%
if(Request.Form('NAME')==''){
     Response.Write('<table width="448" border="0" cellspacing="0" cellpadding="0" background="../images/c_icbox.gif" height="365" align="center">');
     Response.Write('  <tr> ');
     Response.Write('    <td>');
     Response.Write('      <div align="center"><img src="images/c_ic_deny.gif"><br>');
     Response.Write('        <font face="verdana" size=2><b>!!! ERROR !!!</b><br>');
     Response.Write('        <b>Please Go Back & Check That You Have Filled In <br>');
     Response.Write('        All The Required Feilds</b></font><br>');
     Response.Write('        <a href="Javascript:history.back();"><<< Back</a></div>');
     Response.Write('    </td>');
     Response.Write('  </tr>');
     Response.Write('</table>');
     Response.Write('');
}
else {
    var Message, Key;
    for (Key in Request.Form) {
     Message += Key + " : " + Request.Form.Item(Key) + String.fromCharCode(13,10);
    }
     
    var objMail = Server.CreateObject('CDONTS.Newmail');
    objMail.From = Request.form('Email');
    objMail.To = 'myemail@mydomain.com';
    Response.Write('myemail@mydomain.com');
      objMail.Subject = '- My Form - ';
    objMail.Body = Message;
    objMail.Send;
    Response.Redirect('itWorked.asp');
}
%>
0
 
LVL 7

Author Comment

by:jay_eire
Comment Utility
its saying

Microsoft JScript runtime (0x800A01B6)
Object doesn't support this property or method

line 94 is

objMail.Send;
0
 
LVL 6

Accepted Solution

by:
Mike_Metro earned 300 total points
Comment Utility
sorry...try

objMail.Send();
0
 
LVL 7

Author Comment

by:jay_eire
Comment Utility
EXCELLENT EXCELLENT!!!! Thank you sooooooooooo much!
thats working now!
Cheers Mate.
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
My pleasure.  
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
Glad it worked for you.  FYI, you haven't accepted my answer.  

Thanks.
0
 
LVL 6

Expert Comment

by:Mike_Metro
Comment Utility
Great thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now