This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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.