firstly I have 2 problems...
I want to catch an empty SQL statement to deliver an error message to the user - currently the last SQL statement posted by the user is returned... Is there an isEmpty() method or similar? I have looked an found nothing on sun's website.. or if anyone has any ideas I would be greatful. ( :
Also I have a Javascript problem. I want to check that the user has only entered numbers into a field. I have a .js file to create a pop up and that doesn't seem to work... here is the code I used:
String url = getInitParameter("popup-url");
if(url==null || url.equals(""))
url = "http://localhost/CCNs/help.htm";
url=request.getContextPath()+url;
//set the MIME type of the response, "text/html"
response.setContentType("text/html");
RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/javascript.functions.js");
dispatcher.include(request, response);
out.println("<form>");
out.println("<input type=\"button\" name=\"help\" " + "value=\"Help\" onKlick=\"CreateWindow('" + url+ "')\">");
out.println("</form>");
And here is the function.js:
<script language="JavaScript">
function CreateWindow(uri)
{
var newWin=window.open(uri, 'newwin1',width=500,height=400,resizable,' + 'scrollable,scrollbars=yes');
newWin.focus()
}
</script>
When I click on the "help" button I get "error on page" message in the status bar.
Thanks in anticipation!
Gemma