Questions tagged [radio-group]

radio-group is used to create a multiple-exclusion scope for a set of radio buttons. Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group.

1047 questions
31
votes
4 answers

With Bootstrap, how do I show radio inputs as buttons?

My form currently contains this code:
Likk
  • 747
  • 3
  • 7
  • 8
31
votes
3 answers

How to evenly space out radiobuttons in Android?

I have three radiobuttons and I want to evenly space them across the screen. When I use android:layout_weight="1", the buttons are stretched out across the screen. So how would I have the same amount of space in between each of them that also scales…
rasen58
  • 4,672
  • 8
  • 39
  • 74
30
votes
13 answers

RadioGroup with two columns which have ten RadioButtons

I have a RadioGroup and I want to align buttons next to each other in two columns and five rows and I am unable to achieve it. Things I have tried: RelativeLayout -> Outside RadioGroup -> Inside RadioGroup. All RadioButtons are selected, but I want…
Jason Wood
  • 737
  • 1
  • 13
  • 22
27
votes
4 answers

Android radiogroup, divider between radiobuttons

Is there a simple way to add a divider between RadioButtons inside a RadioGroup? I've tried using the divider xml attribute and it doesn't seem to be working. In case it's relevant, the RadioGroup in my layout does not contain any child views; I'm…
Karakuri
  • 38,365
  • 12
  • 84
  • 104
26
votes
5 answers

RadioGroup calls onCheckChanged() three times

I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single check() call raises three events - once for the first RadioButton and twice for the second, which is my target.…
user1526659
21
votes
2 answers

How do I listen for changes to a RadioGroup's selected value using JQuery?

I need to register a handler for a group of radio buttons. I'm using JQuery and hoped that its .change method would accomplish this. However I have not experienced the desired behavoir. Here is a sample snippet I've written. Sadly, the…
Justin
  • 10,667
  • 15
  • 58
  • 79
21
votes
1 answer

Making RadioGroup radio buttons with images in Android... How?

Is it possible to make Radio Buttons in Android, where there are image representation to a button instead of a regular buttons? I want it to look something like that: The cyan in the middle represents the selected button. How can I do it?
Igal
  • 5,833
  • 20
  • 74
  • 132
18
votes
4 answers

Manage Layout Inside a Horizontal Oriented Radiogroup

I am using a TableLayout with TableRows as my main activity. Inside the TableLayout is a Radio Group containing 2 Radio Buttons inside the activity (the Radio Group being inside a table row). I want to be able to align the rightmost radio button to…
deteego
  • 181
  • 1
  • 1
  • 5
17
votes
7 answers

Preparing customized radio group type of layout

I am trying to prepare custom radiogroup like layout in the below image. I have nearly 8-10 rows to do that. So, I prepared one linear layout which has horizontal orientation and added the imageview, textview and radiobutton programatically. So if…
Apparatus
  • 411
  • 1
  • 5
  • 19
17
votes
3 answers

Custom layout for RadioButton

Is there any way I can change the layout for a RadioButton and still have the RadioGroup recognise it? what I need is that the layout will include a couple of EditText fields so that when the user selected that button those fields become active. I…
theblitz
  • 6,683
  • 16
  • 60
  • 114
15
votes
9 answers

How to check which radio button of a radio group is selected? [ANDROID]

I am using two radio groups with multiple radio buttons, I want to check which radio button is selected so that I can call specific functions accordingly. I am using getCheckedRadioButtonId method to do this, but it's throwing null pointer…
User
  • 692
  • 2
  • 11
  • 29
14
votes
6 answers

radio group setOnCheckedChangeListener

I have some problem with radio group, I am new to Android development so I don't have much idea to how can handle it.This is form which has some input filed and radio group for choosing gender and save button. but I don't know where can I exactly…
mkafiyan
  • 944
  • 2
  • 9
  • 31
14
votes
3 answers

RadioGroup empty field check using setError in Android

I was wondering how to setError for a RadioGroup[gender] with RadioButton's [gender_b,gender_c] if it is null. This is how i'm getting the RadioButton values though: private boolean genradiocheck() { boolean gender_flag = false; if…
MetaldroiD
  • 436
  • 2
  • 5
  • 17
14
votes
1 answer

android add padding between radiogroup buttons programmatically

I have a radiogroup in xml, and the buttons are generated programmatically. How do I add spacing between the buttons programmatically. I thought it was something like LayoutParams but my object doesn't come with an obvious setPadding or setMargins…
CQM
  • 42,592
  • 75
  • 224
  • 366
13
votes
1 answer

Make mat-radio-button a required field in a form

I am using a form in Angular 6, and I am disabling the submit button on this condition:
1
2
3
69 70