button passed to URL

M

middletree

I've never seen this before. I am new to querystrings, as just using hidden
fields and the POST method has been more than adequate for me until
recently. But I started using the GET method, and I noticed that when I
clicked the submit button, it gave me this for a URL:

http://localhost/DisplayTickets.ASP?selectTSE=271&Status=2&btnsearchTSE.x=28&btnsearchTSE.y=11

The thing is, selectTSE and Status are the two <SELECT> boxes, so I
understand them being there. But why is is telling me the x and y
coordinates of where I clicked the button to submit the form?

I should add that the submit button is an image, not a regular button.

This doesn't hurt anything, just wondering why it's there. And maybe it will
hurt something later on; I don't know enough to say.
 
R

Ray at

That's the x/y coordinates of where you click on the type=image submit
button. This is just the nature of the input type=image and GET. Try not
naming the input. Just do <input type="image" src="image.gif">

Ray at work

middletree said:
I've never seen this before. I am new to querystrings, as just using hidden
fields and the POST method has been more than adequate for me until
recently. But I started using the GET method, and I noticed that when I
clicked the submit button, it gave me this for a URL:
http://localhost/DisplayTickets.ASP?selectTSE=271&Status=2&btnsearchTSE.x=28&btnsearchTSE.y=11
 
M

middletree

Removing the name of the button didn't change the fact that the x and y
showed up in the URL. Oh well. It doesn't hurt anything.
 
D

Dave Anderson

Ray at said:
That's the x/y coordinates of where you click on the
type=image submit button. This is just the nature of
the input type=image and GET. Try not naming the input.
Just do <input type="image" src="image.gif">

Just a note, Ray. The x/y coordinates are there for POST submissions as
well. And not naming the input just means there will be unnamed x and y
coordinate in the request:

...myURL.asp?x=12&y=34

And I agree that it hurts nothing to be there. I use unnamed image inputs
whenever I want to allow submission on [Enter] in a form with more than one
text input. In my case, they're usually 1x1 transparent images that are
incidental to the page design (we mostly use stylized text links in place of
graphical submit buttons).


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
R

Ray at

What shows up then? Just an x and y without any name? Huh. The
coordinates thing also irritates me. :] If it bothers you very much, you
could always do a "onclick=document.formname.submit();" and just make it a
normal image. This is if you want to rely on client-side scripting of
course.

Ray at work
 
M

middletree

Ray at said:
What shows up then? Just an x and y without any name?
Yes.

Huh. The
coordinates thing also irritates me. :] If it bothers you very much, you
could always do a "onclick=document.formname.submit();" and just make it a
normal image. This is if you want to rely on client-side scripting of
course.


I do have the option of relying on client-side scripting, since this is an
Intranet app. Probably just leave things as they are, though. Thanks.
 
M

middletree

Thanks. This in interesting. Never heard of using text links for submission
before. Got a tutorial for this?
 
D

Dave Anderson

middletree said:
Thanks. This in interesting. Never heard of using text
links for submission before. Got a tutorial for this?

It's the same as Ray's image suggestion, only you have to cancel the click
event:

<A HREF=""
ONCLICK="document.myForm.submit();return false">

FWIW, ONCLICK is not supported for <IMG> in some legacy browsers (like NN4),
so if you care about that kind of thing, use <A> instead, or stay with
<INPUT TYPE="image">.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top