Page 1 of 1

How to make radio button like a button

Posted: Wed May 22, 2019 7:39 pm
by cosyxu
Hi Amo,

I have been using the following js code to make a radio button looks like a button.
Code: Select all
$("#search_Flag").find("div.radio").addClass("radio-inline").css("padding-left","0px");
$("#search_Flag").find("input.pmdynaform-control-radio").parent().addClass("btn btn-default").css("margin-bottom","10px").css("padding","10px 40px").css("white-space","normal").css("text-align","left");
It works, but I want to change the color of the button when a user click it, like the "active" class.

Is there anything that we can improve? Please see attached screenshot.

Thanks,
YX

Re: How to make radio button like a button

Posted: Wed May 22, 2019 10:02 pm
by amosbatto
I created a programming example to explain how to do it:
https://www.pmusers.com/index.php/Turn_ ... to_buttons

Re: How to make radio button like a button

Posted: Wed May 22, 2019 10:19 pm
by cosyxu
amosbatto wrote: Wed May 22, 2019 10:02 pm I created a programming example to explain how to do it:
https://www.pmusers.com/index.php/Turn_ ... to_buttons
That's brilliant. 8)

Thanks,
YX