I have this form :
<form method='GET' name='search' action='index.php?explore=search'>
<input type="hidden" name="searchType" value="all" />
<input class="inputSearchSmall" name="search">
</form>
<a href="javascript:document.search.submit()"><img src="img/button_search.png" class="buttonSearch" /></a>
and I’d like to add parameters on the query string, after the action link. So, the result must be:
http://localhost:8080/website/index.php?explore=search&searchType=all&search=example
not :
http://localhost:8080/website/index.php?searchType=all&search=example
what’s the best way to do this? Adding a hidden param like :
<input type="hidden" name="explore" value="search" />
Or can I concatenate the parameters to the action script in some way?
Adding them via a hidden param like you’ve suggested is the best way to go. It’s more maintainable than adding to the form’s action attribute value, and will do exactly what your asking. Just make sure you put it within the form tags.