I’d like to modify the action attribute of the element to include whatever text is typed into the field. Here’s an example of what I’m trying to do, but can’t:
<form action="/search/?searchoption=Audio&s=Blocks--[text input here]" method="post" name="audio-search-form">
<input name="audiosearch" type="text" size="30" id="audiosearch">
<input type="submit" name="audio-search-submit" value="Search Audio">
</form>
Thanks
If your example form is all there is to it, why not just make the form method a GET request?
edit: argh! Sorry, I overlooked the
Blocks--part that you want to prepend. I’ll still leave this here for reference though, as this could be useful to you. (And ifBlocks--is always going to be constant, you might just as well add it as a separate hidden field, or ditch it altogether and add it in the back-end.)edit 2: to clarify, is there something wrong with the following resulting search url:
which could be achieved with, for instance:
?