The CreatorCon Call for Content is officially open! Get started here.

How to hide radio button option.

Meenal Gharat
Tera Guru

Hi All,

How can we hide radio button option on the basis of users country code.

I tried using g_form.removeOption() but it doesn't worked.

What do we use to hide Radio Button option in client script?

Note : Also tried using -

 if(result == 'US')
{
//g_form.removeOption('phone','Iphone 7','iphone');
var radiobtn = document.getElementsByName("myid");
//radiobtn.checked = true;

radiobtn.style.visibility="hidden";
radiobtn.style.display="none";

 

1 ACCEPTED SOLUTION

Elijah Aromola
Mega Sage

I wouldn't use DOM manipulation for this. You could do a select box and use g_form.removeOption().

Please mark this as correct/helpful if this resolved your issue!

View solution in original post

6 REPLIES 6

Elijah Aromola
Mega Sage

I wouldn't use DOM manipulation for this. You could do a select box and use g_form.removeOption().

Please mark this as correct/helpful if this resolved your issue!

Hi Elijah,

Thanks for your reply. I changed the Multiple choice field to Select Box 

Is this a correct way to removeOption from catalog form?

    g_form.removeOption('phone',Iphone_8);

 

Thanks and regards,

Meenal

 

It is g_form.removeOption("field_name", "option_value");

Please mark this as correct/helpful if this resolved your issue!

Thanks for your advice. 

It worked for select box.

 

Regards,

Meenal