I have read through a number of posts on this and tried different approaches but am still having trouble. I have an html form in a php page which has an onClick command to run a javascript validation procedure when the user clicks a button on the screen. This all works fine, but at the end of the validation I want to open a new php page in the same tab based on the value of a customURL variable (which does contain the correct URL). But the page will only reload itself,not the new page. I have tried window.location.href, location.href and document.location. Does anyone have any ideas why none of these work, or can suggest an alternative approach? Thank you.
if(optionChosen == "overview") { customURL ='overview.php'; }
if(optionChosen == "tasks") { customURL ='tasks.php';}
if(optionChosen == "guidance") { customURL ='guidance.php';}
if(optionChosen == "feedback") { customURL ='feedback.php';}
if(optionChosen == "progress") { customURL ='progress.php';}
customURL = customURL + "?uid=" + unitChosen;
document.location = customURL;