Evening!
I'm having a spot of an issue figuring out how to get a particular section of code to work, I have this:
<form> TestCheckBox <input type="checkbox" name="TestCheckBox" value="Yes" /> </form> <div id="search"> <input type="text" id="search_bar" /> <input type="button" value="Search!" /> </div> And in a php file, I have this:
if($_POST['TestCheckBox'] == 'Yes'){ echo "TEST"; } if (isset($_POST['action']) && !empty($_POST['action'])) { generateHTML($_POST['action']); } else { echo "NOTHING IS HERE"; } Obviously this is not how to do this. I'm curious as to hwo I can make my search bar submit the post data also included in the checkbox.
(It's for a search bar, and the checkboxes are advanced search options, so naturally I only want one search button).
Thank you!
</form>before you add the search_bar and search button. If you want the form to include them as well (to be in your POST), move that tag to below the two input tags.