How do i stop the browser jumping to top of page when the submit button is clicked?
I'm using the C5 form block with the 'form tableless layout' pluggin. Currently my form appears at the bottom of my product pages to enable users to request further information, If the user tries to submit the form without all fields being filled in the error checking is triggered however the browser takes the user back to the top of the page. How can i stop this from happening so it remains in the same place?
The submit button code is below:
<input type="submit" name="Submit" class="submit" value="<?php echo $translatedSubmitLabel; ?>" />
Any help would be greatly appreciated
The form sends post data that is evaluated, and once evaluated the page needs to be rendered again to include the response.
There are ways to work around this with ajax and here is a free add-on doing exactly that for you:
Please mark my answer so others with the same (or similar) question knows it's a good one.