>>> pk2474 <[EMAIL PROTECTED]> 06-Jan-00 1:39:17 PM >>>
Ok... here is slightly annotated code:
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE> SITE CHALLAN ENTRY FORM
</TITLE>");
out.println("<SCRIPT language='JavaScript'>");
// array initialization and JavaScript code
1 out.println("++i;");
// JavaScript code
out.println("</SCRIPT></HEAD><BODY>");
out.println("<h1>Kanchan Carriers</H1>");
2 out.println("<FORM name=F method=GET");
3 out.println( "action=' "+" ' "+
res.encodeURL("/servlet/SiteEntry") + " ' " + " '> " );
// FORM DETAILS
out.println("</TABLE><INPUT TYPE=SUBMIT
VALUE=ENTER></FORM></BODY></HTML>");
Line no. 1 looks dodgy because there is no JavaScript variable i.
Have you missed out stuff?
If this is where you are getting your plus problem you could try
putting HTML quotes after the script tag, eg:
<SCRIPT>
<!--
//js goes here
-->
</SCRIPT>
This stops the HTML parser from trying to interpret the JS as HTML.
Something that some browsers do fall for on occasion.
Line no.2 needs a space after the GET, eg:
out.println("<FORM name=F method=GET ");
Also the way I see this it looks like line no:3 will output:
action= ' ' ... ' ' >
2 single quotes do not a double quote make. Instead use this:
out.println( "action=\" "+ res.encodeURL("/servlet/SiteEntry") +
"\">" );
which will output:
action="...">
The \ before the " quotes the " so that it does not close the
string.
Hope that helps.
Nic Ferrier
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html