I have replaced the <> brackets with () in the script block because of errors when trying to post.
I would like to execute a function if the 'checked' property of a radio button changes. For testing, I have tried:
(script type="text/javascript")
function studentNameFunction() {
alert('changed');
}
(/script)
<input type="hidden" name="Product_Attributes[5]:code" value="StudentName" data-attribute-type="radio" id="studentName" />
<input type="radio" name="Product_Attributes[5]:value" value="No" id="l-no" data-attribute="StudentName" checked " />
<input type="radio" name="Product_Attributes[5]:value" value="Yes" id="l-yes" data-attribute="StudentName" onchange="studentNameFunction()" />
After the page loads, I change the radio selection from "No" to "Yes" but nothing is happening.
I would like to execute a function if the 'checked' property of a radio button changes. For testing, I have tried:
(script type="text/javascript")
function studentNameFunction() {
alert('changed');
}
(/script)
<input type="hidden" name="Product_Attributes[5]:code" value="StudentName" data-attribute-type="radio" id="studentName" />
<input type="radio" name="Product_Attributes[5]:value" value="No" id="l-no" data-attribute="StudentName" checked " />
<input type="radio" name="Product_Attributes[5]:value" value="Yes" id="l-yes" data-attribute="StudentName" onchange="studentNameFunction()" />
After the page loads, I change the radio selection from "No" to "Yes" but nothing is happening.
Comment