Posted: 11/7/2010 2:29:58 PM EDT
|
I'm working on a mockup of a website for usability testing. One of the "functions" is a search, done with the standard textbox/button. I just have to fake this functionality for the sake of testing how easy the page is to use. I can't get it to work at all.
This should be simple––if the user enters the word "perkscard" in the box, go to one page, otherwise go to the other page. I keep getting stuff tacked on to the end of the URL though, when I run it locally. Some code:
It's not consistent because I've been messing with it for hours. I really need to get this figured out. Any ideas? |
Try this out.
|
|
Quoted:
No luck with any of the above. It keeps adding a querystring to the end of the url, i.e. when I click I get the url + ?q=perkscard The <input type="image"> acts as a submit button for the parent <form>. Add an onsubmit event handler to the <form> and return false after calling your function to prevent the default onsubmit handler from being fired. |
|
Quoted:
Quoted:
No luck with any of the above. It keeps adding a querystring to the end of the url, i.e. when I click I get the url + ?q=perkscard The <input type="image"> acts as a submit button for the parent <form>. Add an onsubmit event handler to the <form> and return false after calling your function to prevent the default onsubmit handler from being fired. Did this––no luck. One observation––I'm on my local drive. The path to the page is with backslashes i.e. "C:\Documents and Settings\.....". The window after clicking is "file:///C:/Documents and Settings/...." It almost looks like its messing up the path |
|
Quoted:
Quoted:
Quoted:
No luck with any of the above. It keeps adding a querystring to the end of the url, i.e. when I click I get the url + ?q=perkscard The <input type="image"> acts as a submit button for the parent <form>. Add an onsubmit event handler to the <form> and return false after calling your function to prevent the default onsubmit handler from being fired. Did this––no luck. One observation––I'm on my local drive. The path to the page is with backslashes i.e. "C:\Documents and Settings\.....". The window after clicking is "file:///C:/Documents and Settings/...." It almost looks like its messing up the path In my case it's bringing up noresults.html when I have nothing in the box, but when I hit back, the query string is there. It'll go away if you set the form method to post. |