I have a form that I would like to submit. Once done redirect the page to another. However currently it is not working for me.
<form name="myname" method="post" action="actionurl" onsubmit="gotonext()">
function gotonext(){
var portalpath = window.location.pathname;
var myredirect = portalpath +"?uP_fname=msu/survey&command=display&sid=162";
alert(myredirect);
window.location.href = myredirect;
}
So the alert displays the correct url that I am seeking to go to. And the form submits the data to the correct actionurl. What is not working is the redirect.
Any ideas on where I might be going wrong?