How can I prevent the page from submitting when I click a tab?

So instead of,

<button class="tablinks" 
    onclick="viewTab(event, 'capitalrequest')" 
    onsubmit="return false;">Capital Request</button>

It should be:

<button type="button" class="tablinks" 
    onclick="viewTab(event, 'capitalrequest')" 
    onsubmit="return false;">Capital Request</button>

You can also remove onsubmit="return false;" as it is no longer necessary.

Leave a comment

Your email address will not be published. Required fields are marked *