AMP form issue in a MVC framework

98 Views Asked by At

I am having an issue with a form using AMP.

The form works perfectly on a standard amp html page - the button is clicked and the search.php is triggered.

<form method="post" action-xhr="search.php" target="_top">
<input name="query" placeholder="search" id="query" size="40" value="">
<button type=submit class="btn-search"><amp-img ></amp-img></button>
<input type=hidden name=search value=1>
</form>

Then the exact same code (including all the includes, etc) on the MVC framework I am using doesn't work. The button is clicked and nothing happens.

Source codes on both are identical when viewing page source.

Should this not be happening - the specific MVC framework I am using possibly has an issue with this?

Or is it due to it being MVC, the view (header.twig) has the form on the not working version. Would the php code from search.php go into the controller?

Any help would be greatly appreciated!

0

There are 0 best solutions below