Question

I have created two buttons that lead to the NewForm.aspx pages I have linked to the buttons. The one link works like a charm, the other link has the correct web address but when the button is clicked, it just refreshes the page it was just on. Why is this?

I have tried debugging and nothing pops up in the console.

Was it helpful?

Solution

As per my understanding (Correct me if I am wrong), you forgot to add the type="button" to your button element.

So, Add type="button" to the button.

<button type="button" onclick="yourFunction()">Click Here</button>

Reference: prevent refresh of page when button inside form clicked

Also, it will be easier to answer your question more precisely by looking at at the code you are using currently. Can you please add the code you are using to your question?

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top