![]() |
Inserting Selected Option Values into a Search URL
I'm trying to inject the selected value from these select options into an overall search URL... I'm breaking URL up and adding the query items from each select into the center.
What is wrong with the way I'm doing it? It's not working correctly.... Code:
<form name="redlinesearch"> |
You aren't "escaping" the values. So, for example, if you put the value "30x+" into the URL, that + is seen as space character. *ALL* + signs are seen as spaces: It is one of the accepted encodings of space (the other is %20). If you want a real + sign, you must encode it.
On top of that, because you are using a SUBMIT button, the *NORMAL* action of the <form> is *STILL* performed. So very likely the normal submit action wipes out your location.href. But I have to ask: *WHY* do it this way??? What's wrong with just using HTML and getting the JavaScript OUT OF THE WAY!!! Why not simply: Code:
<form action="http://www.redlinewheel.com/index.php" method="get"> |
| All times are GMT +1. The time now is 10:40 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.