I built my own search engine at my website.
I want the output of my search at URL when I click Submit (as Search Button) is :
http://inindonesia.org/marketplace/tags/oleh-oleh-khas-medan
But, When I click Submit (search button), the output is :
http://inindonesia.org/marketplace/tags/?search=oleh+oleh+khas+medan&hidden=oleh-oleh-khas-medan&Submit=Cari+Produk
My code is :
<form autocomplete="off" action="/marketplace/tags/(i want this get parameter from the value input id "hidden", example : oleh-oleh-khas-medan)" method="GET">
<table border="0" border="0" cellpadding="2px" cellspacing="2px" width="100%" bgcolor="">
<tr>
<td style="font-size:12px; text-align:left;" width="80%">
<input id="search" name="search" type="text"/><input id="hidden" name="hidden" type="hidden"/>
</td>
<td style="font-size:12px; text-align:right;" width="20%">
<input id="searchsubmit" name="Submit" value="Cari Produk" type="submit">
FYI: I am using Wordpress at my site.
Any ideas to change the url parameter like I want?
Thanks
Try something like this..... or You want something Different? Explain?
HTML
<form autocomplete="off" action="" onsubmit="return submitform()" method="POST">
<table border="0" border="0" cellpadding="2px" cellspacing="2px" width="100%" bgcolor="">
<tr>
<td style="font-size:12px; text-align:left;" width="80%">
<input id="search" name="search" type="text"/><input id="hidden" name="hidden" type="hidden"/>
</td>
<td style="font-size:12px; text-align:right;" width="20%">
<input id="searchsubmit" name="Submit" value="Cari Produk" type="submit">
</td>
</tr>
</table>
</form>
JAVASCRIPT
<script type="text/javascript">
function submitform()
{
var hiddenFieldValue = document.getElementById('search').value;
hiddenFieldValue = hiddenFieldValue.replace(/\s+/g, '-').toLowerCase();
//alert(location.host+'/marketplace/tags/'+hiddenFieldValue);
window.location = 'http://'+location.host+'/marketplace/tags/'+hiddenFieldValue;
}
</script>