WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. revlimiter
    Member
    Posted 5 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.
    example:
    http://www.kimstewart.ca/blog/search/money/

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

  2. Mark / t31os
    Moderator
    Posted 5 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. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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
    Member
    Posted 5 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?
    Thanks!

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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
    Member
    Posted 5 years ago #

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

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

    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" ... />
    ...
    CSS:
    .searchSubmit{
    background: url(image/btn.png) center no-repeat;
    border: 0;
    ...
    }
  7. Ellis Benus
    Member
    Posted 4 years ago #

    Thank you for this thread!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.