How do i stop the browser jumping to top of page when the submit button is clicked?

Permalink
Hi

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

many thanks

View Replies: View Best Answer
adajad replied on at Permalink Best Answer Reply
adajad
Well, that is how it is designed.

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:
http://www.concrete5.org/marketplace/addons/ajax-form/...
xxjames1975xx replied on at Permalink Reply
Thanks for your time in replying, your suggestion has worked a treat.

cheers
adajad replied on at Permalink Reply
adajad
Great to hear!

Please mark my answer so others with the same (or similar) question knows it's a good one.
wagdi replied on at Permalink Reply
wagdi
Thanks for the tip adajad. Done the job. :)