This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm using an image as a submit button in my XSLT file. The tag I'm using is <input type="image" name="submit" src="file path of image" />. The problem I'm having is that upon pressing the button (image), my URL contains X and Y attributes of the image as parameters (submit.x= and submit.y =). While this does not ruin the use, it is ugly.
There must be a way I can avoid posting these parameters in the URL of my servlet call. Anybody know how?
Well, no, you are using XSLT to generate HTML which contains said submit button, isn't that right? Unfortunately I can't tell whether your question is whether the link actually needs those attributes or what. Could you give us some actual examples of the HTML, if that's the problem? Or an example of the XSLT that's generating it, if that's the problem?
Joined: Oct 16, 2001
It's really an HTML issue. Every examples I've found of using an image as a submit button does the same thing so I suspect that's just the way it is. I would just like to get rid of those x and y components from my URL if possible. Below is my XSLT excerpt:
I must be missing something here. The only strange thing I notice about the URL in that <image> link is that it's pointing to a location on the client's system. What are these x and y components you're asking about?
Joined: Oct 16, 2001
Using the code posted above, when the image button is pressed, the generated URL will be something like:
Note the x and y components of the image button named "submit". If you don't give the image button a name, the URL will contain x=7&y=11. The values change and lead me to believe that it has somthing to do with the location of the control on the form.
What I'd like to do is not have that useless information show up in my URL at all.
It took me a while to duplicate your complaint, because I don't normally use Internet Explorer as my browser. But when I changed the HTML to use a proper URL (not just a file path) in the <input src=""> attribute, I found that Firefox does the same thing. So then I wasn't too surprised to find this in the HTML 4.01 recommendation:
When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where "name" is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively.