I recently created an events form that required an extra validation to check for the ticket quantity available vs the ticket quantity requested. This events form sits on a longer page which gave me the issue of how to make sure that the user sees any errors or messages, etc.
The solution was to jump to an anchor in the page using javascript.
I did read some other similar posts, however the solution mentioned was not working for me. In case this can be useful for someone else I've decided to share.
Simply replace "ANCHOR_ID" with the correct ID in your page/form.
The solution was to jump to an anchor in the page using javascript.
I did read some other similar posts, however the solution mentioned was not working for me. In case this can be useful for someone else I've decided to share.
window.onload = function() {
var form = document.getElementById("ANCHOR_ID");
form.scrollIntoView();
}
Simply replace "ANCHOR_ID" with the correct ID in your page/form.