I am trying to make the checkout page a change fields when a radio button is selected. So I have 2 options on the radio buttons option A and B When A is selected I want 2 fields below to remain available and other 2 to disappear. The other way around when the second radio button is checked.
I mostly used Wordpress for this website but I need a bit of code for this functionality.
function yesnoCheck('radio-5984531736') {
if (this.radio-5984531736 == "Persoana fizica") {
alert("check");
document.getElementByClassName("juridica").style.display = "block";
} else {
document.getElementByClassName("fizica").style.display = "none";
}
}
I have this code as script in the header. I am not sure if it is not correct or I don t have a code to call this function. The Id and class names are the following:
Radio buttons id : radio-5984531736 Info that should show when A selected class name : fizica Info that should show when A selected class name : juridical