Eclipse is erroring on the onkeypress line of the code below with;
Multiple annotations found at this line:
- Tag (input) should be an empty-element tag.
- Cannot return from outside a function or method.
- Invalid text string ()
Now, I have use this in the past but now with Eclipse 10 it is erroring.
Any suggestions would be great.
Thanks
Multiple annotations found at this line:
- Tag (input) should be an empty-element tag.
- Cannot return from outside a function or method.
- Invalid text string ()
Now, I have use this in the past but now with Eclipse 10 it is erroring.
Any suggestions would be great.
Thanks
Code:
<script language="JavaScript">
function Submit()
{
if(window.event && window.event.keyCode == 13)
{
document.QueryForm.pageNum.value='1';
document.QueryForm.submit();
}
else { return true; }
}
</script>
<form action=search.jsp name="QueryForm">
Enter query text:<input type="text" name="query" value="<%=query%>" size="50" onkeypress="return Submit()">
<input type="submit" onclick="javascript:Submit();"/>
Comment