By the sound of your question, I'm guessing that you are using Kentico Portal Engine, which is based on ASP.NET Web Forms. This technology has a certain limitation, i.e. the entire page is a form (you can check this if you see the HTML source of the page). So, when you add a static HTML markup with form tag it basically inserts the form (your static search form) inside the other form (which is wrapping the page) and this is invalid HTML markup. The approach you are trying to use here is more like MVC and this will not work with Web Forms.
What you should do however is to create a new custom Web Part (.ascx), implement your logic inside button click event and place your web part on the sidebar or whenever you need (or add it globally into layout).