Question

I would like to check only one radio button but in my code both radio buttons get selected. Here is my code its in netsuite.

<input value="<%=getCurrentAttribute('item','internalid')%>"  type="radio"    name="service_level"  onclick="getAddonFromNetsuite(<%=getCurrentAttribute('item','internalid')%>, '<%=getCurrentAttribute('item','pricelevel5')%>');"><label for="radio-2-1"></label>
<input value="INPUT"  type="radio" id="radio-2-2" name="service_level_1"  onclick="getAddonFromNetsuite(<%=getCurrentAttribute('item','internalid')%>, '<%=getCurrentAttribute('item','pricelevel5')%>');"/><label for="radio-2-2"></label>

here is the link of the site http://shopping.sandbox.netsuite.com/act

Was it helpful?

Solution

Please make the "name" of the radios be same for all.

<input value="<%=getCurrentAttribute('item','internalid')%>"  type="radio"    name="service_level"  onclick="getAddonFromNetsuite(<%=getCurrentAttribute('item','internalid')%>, '<%=getCurrentAttribute('item','pricelevel5')%>');"><label for="radio-2-1"></label>
<input value="INPUT"  type="radio" id="radio-2-2" name="service_level"  onclick="getAddonFromNetsuite(<%=getCurrentAttribute('item','internalid')%>, '<%=getCurrentAttribute('item','pricelevel5')%>');"/><label for="radio-2-2"></label>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top