Below is a JavaScript function that I have:
function GetSelectedItem()
{
var e = document.getElementById("country");
var strSel = e.options[e.selectedIndex].value;
alert(strSel);
var url = "${createLink(controller:'country', action: 'wholeTestUnits', id: strSel)}"
alert(url);
}
When I click the submit button, I want to navigate to the URL action:
<button class="submit_small" onClick="GetSelectedItem();">
<span><g:message code="default.button.submit.label" /></span>
</button>
Unfortunately, the ${createLink}
function is not functioning as expected.