Need help with html and javascript code

RMAG news

I need help with html and javascript code.

I am building a landing page using a third-party builder, which gives out the page HTML. On the page, there is a form to collect tools, so whenever the submit button is clicked the leads data will be sent as a POST request to a particular trigger. This is the inbuilt functionality.

Now I wanted the user to land on a specific page after hitting the submit button I wanted two actions on the same submit button, that is, when someone clicks submit, the leads data to be sent to the POST request and the user to be sent to a different page URL. I researched a bit and found I could achieve this by adding a Java script inside the HTML. so I added that.

But now, if I try this inside an environment like the one in HTML Online Viewer websites, it is running fine. But when I click the submit button on the page directly opening it in the browser, it takes the user to the post request URL. The second action of taking them to another page is not working.

I believe someone here might be able to help me. It’s been days, I am stuck at this.

Leave a Reply

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