I have a form I’m using to search a website and I would like to add a function to be able to search two different areas of the site (for this purpose we’ll call these two areas which are unrelated “Content A” and “Content B”), depending on which radio button is selected. See the code below for details:
<form method="get" id="searchform" action="URLforContentA">
<div><input name="s" type="text" id="s" value="<?php echo wp_specialchars($s, 1); ?>" size="13" /> <input type="submit" id="searchsubmit" class="searchButton" value="Search" /><br />
<input name="searchContentA" type="radio" value="searchContentA" checked />Search Content A <input name="searchContentB" type="radio" value="Search Content B" />
Search Content B
</div>
</form>
My idea is for the action code to change based on which radio button is selected. So for example if I selected radio button “searchContentA” the action would be “URLforContentA” but if I selected radio button “searchContentB”, the action would change to go to “URLforContentB”.
Hopefully this is explained well enough here. Let me know if you have any questions and thanks for looking at this.