This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Your code will cause a double submit to occur. An html:image tag is already a submit button, so you don't need to put a submit in the onclick event to make the submit occur. That's why you're getting strange results: For the submit caused by the button itself, there will be a value in x and y. For the submit caused by the onclick event, these values will be null.