HTML :
<input type="radio" onclick="radioCall(${item.label})" name="radioPurpose" id="${item.value}" value="${item.value}"/> <c:out value="${item.label}" />
Js :
function radioCall(radioValue){
alert(radioValue.value);
}
I am not able to see the alert with texts which have space in between. It worked for one option which was one full text word. I have tried with double quotes as escape characters for values however the value doesnt appear in the alert. Instead i get javascript errors like SyntaxError: missing ) after argument list. Some of my options have brackets as well. any solution for this?
${item.label}
usually has values like:
- Please try to help me!
- You are not 'the' (only) one
- I am not sure (unsure) about what you want.
@Blaze, heres the HTML
<li>
<input id="SELECT" type="radio" value="SELECT" name="radioPurpose" onclick="radioCall(SELECT)">
SELECT
</li>
<li>
<input id="1" type="radio" value="1" name="radioPurpose" onclick="radioCall(S22 (2)(a) More Security)">
S22 (2)(a) More Security
</li>
<li>
<input id="14" type="radio" value="14" name="radioPurpose" onclick="radioCall(testtestte)">
testtestte
</li>
In above 3 options, only SELECT is displayed in the alert. All other options give me javascript errors.