Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Currently I'm implementing Examine search for a website. I have a problem with my webform:
<form method="get" action="/search-results.aspx"> <label> <span> <input type="text" name="s" class="text" /> </span> <input type="image" src="/images/search_but.gif" class="button" value="" /> </label> </form>
If I hit the search button however, instead of a url query like this:
http://localhost/search-results.aspx?s=congress
I get a url query like this:
http://localhost/search-results.aspx?s=congress&x=26&y=19
I really don't know what's causing this extra &x=26&y=19 to be added to the querystring.
Does anyone has experience with this problem?
Thanks for your help,
Anthony Candaele
method="get" is the answer, change that to method="post" and you're good to go...
Cheers,
/Dirk
Hi Anthony,
That is the default behaviour when you use the <input type=image>. The X & Y co-ordinates are sent too.
Not much you can do about it, see the W3C spec: http://www.w3.org/TR/html4/interact/forms.html#h-17.4.1
Cheers, Lee.
Hi Dirk,
I already tried that, if I change the method to method="post" then I get a url without querystring:
http://localhost/search-results.aspx
I wonder if this image button could be the problem (<input type="image" .../>)
Anthony
@Lee I was afraid this was the case. Ok, thanks for the info, I'll try to implement a normal submit button
greetings,
Yup, but you'd still be able to fetch the posted value using Request["s"]?
The alternative is to have a standard submit button and use CSS to style it accordingly (with a "background-image").
Some examples on this website: http://cssbutton.com/forms/
Hi Lee, problem solved, thanks for your tip concerning the styling of the submit button. This is really usefull because a lot of these commercial templates come with image buttons for their search form.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
problems with search form
Hi,
Currently I'm implementing Examine search for a website. I have a problem with my webform:
<form method="get" action="/search-results.aspx">
<label> <span>
<input type="text" name="s" class="text" />
</span>
<input type="image" src="/images/search_but.gif" class="button" value="" />
</label>
</form>
If I hit the search button however, instead of a url query like this:
http://localhost/search-results.aspx?s=congress
I get a url query like this:
http://localhost/search-results.aspx?s=congress&x=26&y=19
I really don't know what's causing this extra &x=26&y=19 to be added to the querystring.
Does anyone has experience with this problem?
Thanks for your help,
Anthony Candaele
method="get" is the answer, change that to method="post" and you're good to go...
Cheers,
/Dirk
Hi Anthony,
That is the default behaviour when you use the <input type=image>. The X & Y co-ordinates are sent too.
Not much you can do about it, see the W3C spec: http://www.w3.org/TR/html4/interact/forms.html#h-17.4.1
Cheers, Lee.
Hi Dirk,
I already tried that, if I change the method to method="post" then I get a url without querystring:
http://localhost/search-results.aspx
I wonder if this image button could be the problem (<input type="image" .../>)
Thanks for your help,
Anthony
@Lee I was afraid this was the case. Ok, thanks for the info, I'll try to implement a normal submit button
greetings,
Anthony
Yup, but you'd still be able to fetch the posted value using Request["s"]?
Cheers,
/Dirk
Hi Anthony,
The alternative is to have a standard submit button and use CSS to style it accordingly (with a "background-image").
Some examples on this website: http://cssbutton.com/forms/
Cheers, Lee.
Hi Lee, problem solved, thanks for your tip concerning the styling of the submit button. This is really usefull because a lot of these commercial templates come with image buttons for their search form.
greetings,
Anthony Candaele
is working on a reply...