Page 1 of 1

Hide none in radio button and put the field in a custom tab

Posted: 2020-12-23 10:34
by balfons
Hi everybody!

I'm trying to hide the value "none" of a radio button by making this field required. It works, but when I make it required I can't put it inside a custom tab.

I posted this question in another forum viewtopic.php?f=4&t=4074&p=15792#p15792 and a user suggested adding this:

$j('#field1').parents('.form-group').appendTo('#custom_tab');

So I defined my tab like this:

var tab33 = dv.addTab( "test", "Test", "th-list" )
.add("linked_to_test");

$j('#linked_to_test').parents('.form-group').appendTo('#tab33');

What happens now is that the field "linked_to_test" only moves to "tab33" when I choose an option (A, B or C) and save the register.

Any ideas?

Thanks in advance

Re: Hide none in radio button and put the field in a custom tab

Posted: 2021-01-08 10:46
by balfons
Hi!

I finally solved this issue using the Multi-Column Layout. Here goes my code:

var row = dv.addLayout([12, 0])
.add(1, ["linked_to_test"]);

dv.addTab("test", "Test", "th-list")
.add (["id", "code"])
.add (row);

So I create a "false" multi-column, put the radio button field inside and then I add the multi-column to the tab. Maybe not the most accurate solution but it works.

Hope it helps if anyone needs it

Re: Hide none in radio button and put the field in a custom tab

Posted: 2021-01-08 11:24
by jsetzer
Thanks for sharing your solution! Well done!