I've got an html (with JS) inside some perl code.
I think that I'm good in that regard, but I'm getting a JS error that I've never seen, can't find, or understand:
Line:40
Char: 38
Error: Expected '/'
code:0
Based on my line count the errors in the middle of a line woth no path-type information or anything else that I'd expect to be missing a "/".
I'm putting the code below (the who script since I'm lost as to where it is.
If anyone can give me some help on locating and correcting the error, I'd appreciate it.
#####################
#!/usr/local/bin/perl
#require "cgi-lib.pl";
use CGI qw(:standard :shortcuts);
$category=param("category"
);
$topic=param("topic");
#MAIN:
#{
# Open text file where tab-delimited input is sent
#$path="../data/forum.txt"
;
$path="../data/$category/f
orum.txt";
#open (TXTFILE,$path)||die "cannot open $path\n";
print qq{
<html>
<head>
<title>AdHoc New Request Form</title>
</head>
<script>
function topicval(){
if (forum.topic.value =="") {
document.forum.topic.focus
();alert ("A Topic is required.")
}
}
function priorityval(){
if (forum.priority.value =="") {
document.forum.priority.fo
cus();aler
t ("High/Med/Low Priority required.")
}
}
function impactval(){
if (forum.impact.value =="") {
document.forum.impact.focu
s();alert ("Did you forget to comment?")
}
}
function submitNow(forum) {
forum.submit();
}
function checkrtn(e)
{
var key = window.event? event.keyCode: e.which;
if (key == 13)
{
alert('Please use SUBMIT button to complete request');
var textAreas = document.getElementsByTagN
ame("texta
rea");
for (var i = 0; i < textAreas.length; i ++)
{
var obj = textAreas[i];
obj.value = obj.value.replace(/\r/," ").replace(/\n/, "");
}
return false;
}
}
document.onkeyup = checkrtn;
</script>
<body bgcolor="wheat">
<table width=60%>
<tr><td align="left"><font size=3 color=red><B> Activity: $category</font> </td><td align="right"><font color=red size=3><b>Comment Input</b></font></td></tr>
<tr><td align="left"><font size=3 color=navy>Keywords: $topic</b></font></td></tr
>
</table>
<center>
<form name="forum" method="get" action="forum.cgi" onSubmit="checkform()">
<table>
<tr>
<td><font color="blue" size=2>Topic:</font></td>
<td><font color="blue" size=2>Priority:</font></t
d>
<td><font color="blue" size=2>Requestors Name </font></td>
</tr>
<tr>
<td><INPUT NAME="priority" SIZE="3" onFocus="topicval()"></td>
<td><INPUT NAME="name" SIZE="20" onFocus="priorityval()"></
td>
<td><INPUT NAME="name" SIZE="20"></td>
</tr>
</table>
<table>
<tr><td><A href = "#bi"><font color="blue" size=2> Comment</font> </A></td></tr>
<tr><td align=left><TEXTAREA NAME="impact" ROWS=4 COLS=100 WRAP="virtual" onFocus="impactval()"></TE
XTAREA></t
d>
<td><INPUT TYPE="button" NAME="button" VALUE="Submit" onClick="submitNow(forum)"
></td></tr>
<!-- <input type ="reset" value="Reset Form"> -->
</table>
</form>
<BR><BR><BR><BR><BR><BR><B
R><BR><BR>
<BR><BR><B
R><BR><BR>
<BR><BR><B
R>
<center>
<font color="red">
<table width=65% cols=2 >
<TR> <TD colspan=2 align="center"> <font size=+2> <B>AdHoc Report Request Help</B></font></TD></TR>
<TR></TR><TR></TR><TR></TR
><TR></TR>
<TR></TR><
TR></TR><T
R></TR><TR
></TR><TR>
</TR>
<TR> <TD width=33% valign ="top"><A name="bi"><font size=+2>Business Impact/Benefit</font></A><
/TD>
<TD width=66%>This is the business case for creating this report. Explain how the information on this report is going to be used to improve PS&L customer satisfaction, metrics and/or processes. Requests that show how actual PS&L cost savings will receive a highr priority. </TD>
</TR>
</table>
</body></html>
}
Start Free Trial