[resolved] Weird Search Results URL --- X & Y Coordinates! (7 posts)

  1. revlimiter
    Posted 7 years ago #

    On http://www.kimstewart.ca/blog/
    click "Search" on the left navigation

    You will notice something similar to http://www.kimstewart.ca/blog/?s=&submit.x=35&submit.y=11&submit=Search in the web address bar.

    Try clicking it again and you will see different X & Y Coordinates. The coordinates of your mouse! I don't know why it's doing this... Any ideas how to fix? I would like for it to just go to http://www.kimstewart.ca/blog/search/ when nothing is typed in and the user clicks Search.

    It seems to work fine when keywords are inserted.

    I can post PHP code if that helps, just need to know which page to post.

  2. Mark / t31os

    Posted 7 years ago #

    It's due to using an image for the submission button..

    Do your form tag like so...
    <form id="exampleForm" name="exampleForm" onSubmit="this.submit();return false;">

    Changing ID and Name to the correct values etc....

    It'll only resolve the problem under Firefox and IE though..

  3. Actually, just take the name and id off of the submit button. You don't need all that extra stuff in the request, just the s parameter. Without an id or name, the submit button will still submit, but it won't get its information sent back in the url.

  4. revlimiter
    Posted 7 years ago #

    Thanks for the info
    I removed the name and id from the submit button

    But now when I click submit it goes to http://www.kimstewart.ca/blog/?s=&x=15&y=13

    I would like for it to goto http://www.kimstewart.ca/blog/search/ when nothing is typed in.

    Any ideas how to do this?

  5. Well, firstly, that's not possible. The search is going to be ?s=whatever and that's all there is to it. You can't make it do pretty for search. Standards issue. You might be able to do it with javascript, but it's complex and anyway wouldn't work without some server side code as well.

    Second, looking at the specs, I'm not sure you can get the x and y to totally go away. That's just what an image input does.

  6. Sepehr Lajevardi
    Posted 7 years ago #

    that's because of using an image typed input for the form submission:

    <form ... >
      <input type="image" src="image/btn.png" ... />

    replace that image typed input with a submit typed input while you're using CSS to set it's background:

    <input type="submit" value=" " class="searchSubmit" ... />
    background: url(image/btn.png) center no-repeat;
    border: 0;
  7. Ellis Benus
    Posted 6 years ago #

    Thank you for this thread!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.