Tuesday, 17 September 2013

Button onclick not redirecting to correct URL

Button onclick not redirecting to correct URL

<button id="promoCodeSubmit"
onclick="window.location.href='http://www.test.com'+document.getElementById('promoCodeValue').value;">Apply</button>
Trying to use the code above to redirect a page. console.log is printing
out the correct URL, but page gets redirected incorrectly. Any ideas why?

No comments:

Post a Comment