문제

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.

도움이 되었습니까?

해결책

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top