FAQ Database Discussion Community


Verify which dynamically created Radiobutton is checked in C#

c#,dynamic,radio-button,panel,tablelayout
I am developing an application with multiple Panels (eight, to be precise) on one Form. In each Panel there are one TableLayoutPanel with three Radiobuttons (among of few other unimportant components). The Radiobuttons set the priority of the specific Panel's input (Priority 1, 2 and 3). I have no intention...

Wxpython Radio Button Preselected

python,user-interface,radio-button,wxpython
I have 3 wxpython radio buttons. When run, the first button (Value A) is already selected. How do I make it so no buttons are selected initially? self.rb1 = wx.RadioButton(panel, -1, 'Value A', (50, 10), style=wx.RB_GROUP) self.rb2 = wx.RadioButton(panel, -1, 'Value B', (10, 30)) self.rb3 = wx.RadioButton(panel, -1, 'Value C',...

If radio button answer is echo

javascript,php,jquery,radio-button
I want to check if the value of the radio is some value and if it is, it needs to echo a text line. I use this code for the radio buttons: <li> <label for="recommend_field"><?php echo $this->__('Would you recommend this product to a friend?') ?></label> <div class="input-box"> <?php foreach (...

Android TextView inside RadioGroup Not Exactly Fitting

android,radio-button,radio-group
I do try to get text datas from JSON, i do. But when it is time to write they are not exactly fitting. My XML file is here... <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:id="@+id/txt_questionAdjective" android:layout_width="fill_parent" android:layout_height="139dp" android:layout_gravity="center_vertical"...

How can we turn radio button checked when we type its input

javascript,html,radio-button
As you see below, I have a radio button group that has three options. The last one is text input. Is there any way to make the last one checked when I type something in its text box? <input type='radio' name='result' value="0"/><label for="0">False</label><br/> <input type='radio' name='result' value="1"/><label for="1">True</label><br/> <input type='radio'...

Using the Knockout hasFocus binding, how do I track the focus of a group of radio buttons?

knockout.js,radio-button,focus
I'm using knockout js, and I have some radio buttons that I have applied the hasFocus binding, so that I can track which control has the focus. But it doesn't work for radio buttons. You can test what happens in this fiddle: https://jsfiddle.net/qttxfvqs/1/ The text box focus observable works fine,...

How to make a Bootstrap radio button continue into a dropdown menu

html,drop-down-menu,radio-button,bootstrap
I would like to have a radio button with a couple options showing, and the rest available in a dropdown menu. I can get the interactions I want by assigning every option to a class, but I would like the color of the dropdown menu to change to the active...

Radio and Checkbox Checked Values Won't Show in JavaScript

javascript,checkbox,radio-button,window.open
I'm trying to get the value of a radio button and multiple checkboxes to appear in a new window using JavaScript. I can't seem to figure out why "true" return instead of the actual value checked. Below is the code and screenshot of the results. function messagebox() { var newWindow;...

JButton variable not found

java,swing,radio-button,awt,background-color
I am trying to change the background color on click of a radio button, but the second radio button, "bt2" variable is not found by the compiler. I keep getting this error message: "cannot find symbol bt1" in the e.getSource()==bt1 Here is my code: public class ColorChooser extends JFrame implements...

Group of Radio Buttons with None selected in MVC

asp.net-mvc,radio-button
I'm new to MVC - I'm creating a simple survey application with a Survey Model and Controller and multiple Views in which users fill out their answers. In my views I have a table of radio buttons, where each row is a group and the user has to select one...

Change input select to radio

javascript,php,jquery,radio-button
I want to change my select code to radio buttons: My current code is: <li> <label for="recommend_field"><?php echo $this->__('Would you recommend this product to a friend?') ?></label> <div class="input-box"> <select name="recommend" id="recommend_field" class="input-text" style="width: 360px;"> <option></option> <?php foreach ( $this->getOptions() as $option ): ?> <option value="<?php echo $option['value'] ?>"><?php echo...

Chrome Vox not getting radio buttons

html,google-chrome,radio-button,accessibility,wai-aria
I'm testing a website for accessibility using Chrome Vox. I have 3 radio buttons, one of which is selected. I have no idea why, but Chrome Vox only reads the selected radio button, the others are ignored. Here's an example: <p>Chrome Vox test</p> <input type="radio" id="radio1" name="radio" tabindex="0" role="radio" aria-checked="false">...

Jquery Image slider not looping

jquery,image,loops,slider,radio-button
I am having a problem with some of my JS. I have an image slider which automatically scrolls through the images, and an image can be selected using radio buttons, but the images will only play through once and then stop. This JSFiddle works best in chrome - https://jsfiddle.net/jw09363f/ Here...

radio button (checkbox hack)

html,css,radio-button,css-hack
I'm trying to use the CSS radio button hack to reveal a hidden div, but I cannot get it to appear when clicked. With the current code below it is hidden, and nothing happens when I click the check box. I intend to add similar boxes (and later hide them)...

How to get all radio button group selections from a form submit

javascript,forms,meteor,radio-button,form-submit
I have a form with many groups of radio buttons which are dynamically generated from a database of questions. They look like this: <input name="group{{../questionNumber}}" type="radio" id="q{{../questionNumber}}_{{answerLetter}}" value="{{answerLetter}}" /> where ((questionNumber}} is just an integer (they go in order from 1) and {{answerLetter}} will be a letter starting from A...

Radio button to change JCombo Data

java,swing,radio-button,jcombobox,buttongroup
Looking for a way to change the data outputted to the combo box by selecting the radio buttons, but the data is being pulled in off a text file and saved into an array and then passed back into JCOMBO array list. sorry if question is a big vague i...

get data searching from radiobutton to combobox

java,swing,combobox,radio-button
I want to search an item, but I get troubled that radio button and combo box show nothing. If you want to get show combo box, radio button must get picked please. I confused what code that I must type for radio button. Can you help me? private void txtSearchKeyReleased(java.awt.event.KeyEvent...

If radio button is selected show alert

javascript,jquery,asp.net-mvc,if-statement,radio-button
I want an alert to show when i click a radio button. My radio buttons: <div class="genericFormField"> New:@Html.RadioButtonFor(m => m.Form.InstallType, 1, Model.InstallationHeader.InstallType == 1 ? new { Checked = "checked" } : null ) Pool:@Html.RadioButtonFor(m => m.Form.InstallType, 2, Model.InstallationHeader.InstallType == 2 ? new { Checked = "checked" } : null)...

On iOS Safari, using radio button to toggle dom breaks radios/checkboxes

jquery,ios,safari,radio-button
The following code works fine on all browsers except Safari on iOS (haven't tested android yet). Simple enough concept. When the user clicks a radio option, I toggle a class to change which additional fields are shown. Works the first time, but after I change it once, all the radio...

How can I toggle a radio button's checked state with jQuery?

javascript,jquery,html,radio-button
As can be seen here, I've got this HTML: <input type="radio" id="radbtnEmp" >rad btn</input> ...and this jQuery: $('#radbtnEmp').click(function () { alert("radbtnEmp clicked"); }); The alert does display when I click the radio button; However, clicking the radio button a second time does not toggle its state back to unchecked. How...

Why does this event fire asynchronously?

c#,asynchronous,sharepoint-2010,radio-button
I've got this code to prevent two opposite radio buttoms from both being checked: RadioButton rbUSCitizenOrPermResY = null; RadioButton rbUSCitizenOrPermResN = null; . . . rbUSCitizenOrPermResY = new RadioButton { CssClass = "finaff-webform-field-input" }; // doesn't allow assignment to CheckedChanged above rbUSCitizenOrPermResY.CheckedChanged += new EventHandler(rbUSCitizenOrPermResY_Changed); . . . private void...

jQuery mobile radio button changed event always fires even if already checked

jquery,jquery-mobile,event-handling,radio-button,onchange
I'm using a radio button group containing two radio buttons to dynamically change the content of my page depending on which radio button is checked. The content should be updated, when the selected radio button changes. Therefor i added an event handler to the radio buttons. html: <fieldset data-role="controlgroup" data-type="horizontal"...

AngularJS radio button

angularjs,radio-button
I try to do this, with radio buttons. I start with angular and I can't apply the same action to radios. <!DOCTYPE html> <html ng-app="angularjs-starter"> <body ng-controller="MainCtrl"> <ul class="module_list"> <li ng-repeat="module in modules"> <div class="span4 module_card" ng-class="{ checked : isChecked }" ng-controller="CheckedController"> <input id="{{module.title}}" type="checkbox" class="custom_checkbox" ng-model="isChecked"><label class="title"...

Bootstrap radio button group knockout binding doesn't work

javascript,jquery,twitter-bootstrap,knockout.js,radio-button
I followed this: http://volaresystems.com/blog/post/2013/12/09/Using-Bootstrap-3-radio-button-groups-with-Knockout-3-data-bindings (jQuery 2.0.3, Bootstrap 3.0.3, Knockout 3.0.0) As far as I can see the only differences are the jQuery, Knockout and Bootstrap version numbers, but the major version numbers match. http://jsfiddle.net/csabatoth/rLtL16xk/12/ (jQuery 2.1.3, Bootstrap 3.3.4, Knockout 3.3.0) <p> Currently selected: <span data-bind="text: selectedOption"></span> </p> <div class="btn-group-vertical"...

How to send a radio button value via AJAX?

javascript,jquery,ajax,input,radio-button
I've created a "global" ajax-modal-function that sends ajax-requests with values stored in data-array at the parent #modal-content. That's how a HTML field looks like (as an example): <input data-array='data[]' name='gender' type='radio' value='1' /> <input data-array="data[]" type="password" name="password" /> That's how I store the data before I use tha $.ajax JQuery...

Get group radio button selected value via jquery

javascript,jquery,html,jquery-selectors,radio-button
How can I get the selected radio button value via jQuery? I tried: var selectedPlan = $("input[name=Plan[packageId]]:checked'").val(); alert(selectedPlan); bBt didn't work. <td style="vertical-align: top;"> <input type="radio" value="1" name="Plan[packageId]"> <lable>3 Games</lable><br> <input type="radio" value="2" name="Plan[packageId]"> <lable>5 Games</lable><br> <input type="radio" value="3" name="Plan[packageId]"> <lable>10 Games</lable><br> </td>...

Force radio button and its label to be on same line

html,css,radio-button
If you have multiple radio buttons, each with a label, what is the most simple way to force the button/label pair to always be on the same line, and force the next pair down to the next line? Large screen: () Label 1 () Label 2 () Label 3 On...

How to fire click event on already-selected OptionButton in Excel Userform

vba,excel-vba,radio-button,userform,optionbutton
I read somewhere that once an option button (or radio button) is selected on a UserForm, click events are not registered. Is this true? If so, what are some good ways around this, aside from using checkboxes instead? Thanks! UPDATE: Per user3561813's suggestion, I tried the MouseUp event with the...

How to use i18n with a Grails radioGroup?

grails,radio-button,gsp
How does the message needs to be set in messages.properties to get the label translated? (I'm on Grails 2.4.4) Domain: int handledBy messages.properties: Case.handledBy.1=Handled by A Case.handledBy.2=Handled by B``` View: <g:radioGroup name="handledBy" values="[1,2]"> <tr class="prop"> <td valign="top" class="name"> <label><g:message code="${it.label}" />:</label> </td> <td valign="top" class="value ${hasErrors(bean:CaseInstance,field:'handledBy','errors')}"> ${it.radio} </td> </tr>...

Drawing a Continuous Line with a Mouse with wxPython

python,python-2.7,radio-button,wxpython
I am trying to make a "whiteboard" application in wxPython. I am trying to figure out how to draw a line that follows the mouse when the user is clicking down. def __init__(self, parent): wx.Frame.__init__(self, parent, title="White Board") self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.OnDrag) def OnDrag(self, e): print "drag" The first step is trying...

Set focus for paper-input via radio button

input,radio-button,focus,polymer,paper-elements
In Polymer (1.0), how can I set the focus of the iron-input when (as example) radiobutton 'radio1' is selected. <div> <div>Title:</div> <paper-radio-group> <paper-radio-button name="radio1">Radio1Label</paper-radio-button> <paper-radio-button name="radio2">Radio2Label</paper-radio-button> </paper-radio-group> <paper-input-container> <input is="iron-input"> </paper-input-container> </div> ...

Trigger on radio-button set via click event?

jquery,radio-button
Im trying to fire a trigger on a radio button, but cant get it to work. It works fine if i use a checkbox instead, but i kinda need the radio button. The radio button can be set by pressing it, or the Test div. If the radio button is...

how to add 2 radio button horizontal to listview in jquery mobile

jquery,listview,jquery-mobile,radio-button
I want to add 2 radio button horizontal in every row my simplelistview sample ...

RadioButtons binding on Windows Phone 8.1

c#,xaml,mvvm,radio-button,windows-phone-8.1
I have some problem with binding my RadioButton property IsChecked. I have two RadioButton's on the grid, which Visibility binded to a property on my viewmodel. What i want to achieve is to always setting first RadioButton to Checked state, when grid is become visible. Here is some code: <Grid...

How do I get the value of radio button option in my Knockout.js wizard?

javascript,knockout.js,radio-button,wizard,knockout-templating
To simplify things, here is the fiddle: http://jsfiddle.net/FyuSD/157/ <script id="choiceTmpl" type="text/html"> <label><input type="radio" value="boughtBefore" data-bind="checked: radioSelectedOptionValue" />Purchase products I have bought before</label> <br /> <label><input type="radio" value="searchProduct" data-bind="checked: radioSelectedOptionValue" />Search for a product I haven't purchased before</label> <br /> I guess I have a couple questions. I am building a...

show radio button values in form

php,radio-button
In this code in php, don´t show the values of radio buttons, echo don´t work <html> <head> <title>Probando radio</title> </head> <body> <form method="POST"> <input type="radio" name="sexo" value="m" checked>Mujer <input type="radio" name="sexo" value="h">Hombre </form> <? php $sexo = $_POST['sexo']; // print ($sexo); echo $sexo; ?> </body> </html> ...

Get Selected Button from RadioButton Group with Wxpython

python,python-2.7,radio-button,wxpython
I have two wxpython radio button groups: self.red = wx.RadioButton(panel, -1, 'Red', (10, q2y), style=wx.RB_GROUP) self.orange = wx.RadioButton(panel, -1, 'Orange', (50, q2y)) self.yellow = wx.RadioButton(panel, -1, 'Yellow', (100, q2y)) self.dot = wx.RadioButton(panel, -1, 'Dot', (10, q3y), style=wx.RB_GROUP) self.triangle = wx.RadioButton(panel, -1, 'Triangle', (50, q3y)) self.rectange = wx.RadioButton(panel, -1, 'Rectangle', (100,...

Using image in RadioButton instead of text

android,radio-button
In Android, I want to use RadioButton, but I do not want to check a plain text. How can I get the display in the first image instead of the second image? Using RadioGroup and RadioButton....

Checked radio button style sibling label

html,css,radio-button
I working on some functionality at the moment, that mask a radio input to look like coloured square, when a radio is selected the sibling label background should change colour, what is happening though is whatever radio button I check, the first label always changes colour, here is my fiddle,...

Allign text with radio in horizontal form

css,twitter-bootstrap,radio-button
I have an horizontal form in bootstrap 3 and I wanted to make my radio buttons bigger on my page as I think their original size is far too small. So i have this code : <div class="form-group"> <label class="col-xs-4 control-label">myfield</label> <div class="col-xs-8" style="padding-top: 9px;"> <label> <input type="radio" name="inpPrjMp" value="1"...

Dynamically added radio button does not act like a different group

javascript,jquery,html,radio-button
I have the following radio buttons <input type="radio" class='form-control' name="progress_type[]" value="Journal Papers"><span class='radio-label'>Journal Paper</span> <input type="radio" class='form-control' name="progress_type[]" value="Conference Proceeding"><span class='radio-label'>Conference Proceeding</span> <input type="radio" class='form-control' name="progress_type[]" value="Conference Presentation"><span class='radio-label'>Conference Presentation</span> I want...

Use radio buttons to show divs

javascript,jquery,html,radio-button
I want to show divs when i check one of the 2 radio buttons. The problem is it always shows the divs at this point. I am also working with cookies to store the choice when i refresh the page. When i work with checkboxes both the divs and the...

For each div trigger radio button on change via juqery

javascript,php,jquery,ajax,radio-button
I need to check which radio button list is clicked and for the clicked to send a jQuery ajax call, at the moment i have table id plan1, plan2, plan3, generated with php. each has a radio button list, with jQuery each how is it possible to make this happen?...

Radio Buttons in Editor Template

asp.net-mvc,radio-button,survey,mvc-editor-templates
I am in the process of creating a 'Progress Report' with a list of questions and multiple choice answers. The questions are populated into the Progress Report automatically via a separate unrelated process in case it is relevant. Code is as follows: Edit View: @model App.Models.ProgressReport @Html.EditorFor(model => model.ReportAnswers) ReportAnswer.cshtml...

Python tkinter variable not working in radiobutton

python,tkinter,radio-button
I have this code.That gives me the selection that user has made through radio button. But unfortunately it only selects zeroes. Code: QueryResults=Tk.Tk() row_no=0 Tk.Label(QueryResults,text="Name ").grid(row=row_no,column=0,padx=5,pady=10) Tk.Label(QueryResults,text="Source ").grid(row=row_no,column=1,padx=5,pady=10) Tk.Label(QueryResults,text="Destination ").grid(row=row_no,column=2,padx=5,pady=10) Tk.Label(QueryResults,text="Source Time ").grid(row=row_no,column=3,padx=5,pady=10) Tk.Label(QueryResults,text="Destination Time...

DataTrigger is not working

wpf,combobox,treeview,radio-button,custom-controls
I'm learning how to create custom controls in WPF, however I'm having problems about how to use the DataTrigger. My component is basically one ComboBox and I added 3 RadioButtons on the the top of it. Here's what I'm trying to do: I created an enum: public enum TipoTree {...

I am using CSS to hide radio buttons, but I would like to display them on one page using Javascript

javascript,css,radio-button,qualtrics
On Qualtrics, I have entered the following CSS to hide radio buttons in the entire survey: input[type=radio]{ visibility: hidden; } However I would like them displayed for one page. I can only use javascript to do this. Is it possible?...

Radio button default checked not working because of JQuery function

javascript,jquery,html,checkbox,radio-button
I have a list of radio buttons binded to a checkbox in the following manner. 1) When the checkbox is checked, the radio buttons are enabled and have a default button checked (say value=1) (only one radio button can be selected out of the three) 2) When the checkbox is...

How to set android:button=“@null” of RadioButton in java code rather than xml [duplicate]

java,android,radio-button
This question already has an answer here: How can I programmatically set android:button=“@null”? 3 answers How to set android:button="@null" of RadioButton in java code rather than xml. I want to set it in java code....

How to validate radio button/checkbox and must to select one in laravel

php,validation,laravel,radio-button
I'm trying to validate a radio button in Laravel. This is my code, but it doesn't work. In my case, i have a dynamic form with many questions with different of type such as : radio, checkbook, single input, number input,... So I have to use array name for each...

Radio Button For Enum (DataAnnotation)

c#,enums,radio-button,data-annotations,html-helper
I have this enum: [Display(Name = "Primary incomplete")] PrimaryIncomplete = 1, [Display(Name = "Primary")] Primary = 2, [Display(Name = "Secondary incomplete")] SecondaryIncomplete = 3, [Display(Name = "Secondary")] Secondary = 4, [Display(Name = "Higher education incomplete")] HigherEducationIncomplete = 5, [Display(Name = "Higher education")] HigherEducation = 6, [Display(Name = "Post-Graduation/MBA")] PostGraduationMBA =...

Input String was not in Correct Format (C#: Radio buttons conversion)

c#,radio-button,format,converter
I am making a simple program where I/the user will select a number (the radio button) and when the "Click" is clicked, a message box will appear and show the result. i am almost there but everytime I click "Click", an error occurs and says: Input string is not in...

Angular radio button doesn't pick an initial value

angularjs,radio-button,angular-ui,angular-ui-bootstrap
I have a radio button with two available values - male and female when the value of male is true and female is false. <div id="gender" class="btn-group"> <label class="btn btn-success" ng-model="userDetails.gender" btn-radio="true" uncheckable>Male</label> <label class="btn btn-success" ng-model="userDetails.gender" btn-radio="false" uncheckable>Female</label> </div> In the controller code, I get the existing value in...

How do I use :checked on radio buttons

css,wordpress,radio-button,checked
How do I use the :checked css for my radio buttons with hidden input buttons? http://cormilu.com.br/loja/sem-categoria/test-2/ I've tried: input[type=”radio”]:checked{ color:red; … } input[type="radio"]:checked+label{ color:red; … } label > input + img{ color:red; … } label > input:checked + img{color:red; … } Is it because of my page setup? Ihid the...

Highlight table row and select radio input when table row clicked jquery

php,jquery,html,radio-button
I'm trying to achieve something similar to this : I want to select a radio input and highlight a table row when someone clicks somewhere in the table .Same idea is this but with radio input http://jsfiddle.net/FbHAV/2/ can I get some help ? What should I change in the Jquery?...

Show alert when radio button value is selected

javascript,jquery,if-statement,radio-button
<script type="text/javascript"> function radio_form(){ var selectvalue = $('input[name=choice]:checked', '#radio_form').val(); if(selectvalue == "V1"){ alert('Value 1'); return true; }else if(selectvalue == "V2"){ alert('Value 2'); return true; }else if(selectvalue == 'V3'){ alert('Value 3'); return true; }else if(selectvalue == 'V4'){ alert('Value 4'); return true; } return false; }; </script> <form id="radio_form"> <input type="radio" onclick="radio_form()"...

Knockout radio button check binding

knockout.js,radio-button
I have ViewModel in which I have array of "Answers". "Answer" is object that has property 'Selected'. In my demo array I have two Answers. For first Selected=1 and for second Selected=0. I have no idea why both radio buttons are selected. Here is my demo link - https://jsfiddle.net/jwoscjot/3/ and...

radio button show values in combo box

java,mysql,if-statement,netbeans,radio-button
I confused with this if-else because I'm new in Java & MySQL and I tried to make it by myself. public Menu() { initComponents(); try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/restaurant", "root", ""); System.out.println("ODBC Connection Successful"); showCategory(); } catch (ClassNotFoundException | SQLException e) { System.out.println("ODBC Connection Failed" + e); } }...

How to insert radio button value into the database?

javascript,php,codeigniter,radio-button
I want to insert selected radio button value into the database. just "yes" or "no". if anyone can give me an idea it would be a great help. I am using codeigniter framework. Thanks in advance. Model function add_reservation($reservation_model) { return $this->db->insert('reservations', $reservation_model); } Controller function add_reservation() { $reservation_model =...

Validation on Radio Buttons

c#,wpf,validation,data-binding,radio-button
I'm not really sure how to word this, so here goes. I've got some radio buttons on a form in my WPF application which get validated. They're basically a required field for this form. When I start to fill in the form, both radio buttons are marked with a red...

Radio button layout messed up in Django template

html,css,django-templates,radio-button
I have Django template where a user fills out her bio, mobile number, age, gender and marital status. Gender and marital status are radio buttons with two options, the former 3 choices are text fields. The template is laid out thusly: <form method="post" action=""> {% csrf_token %} {{ form.bio.label_tag }}{{...

How do I create a RadioButton in my GUI in python?

python,user-interface,variables,radio-button
I've been trying to create a simple RadioButton, but the issue is that both buttons already show up as clicked (they have the black circle inside of them when the GUI starts up). How would I fix this? this.myVar = StringVar() this.button1 = Radiobutton(this.root,text = "Small Boxes First",variable = this.myVar)...

Abnormal Behavior with RadioButton

android,xml,android-layout,radio-button,radio-group
I am using RadioButton in my layout. Where i have provided background to the RadioButton. Below is the code <RadioGroup android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="horizontal"> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@null" android:background="@drawable/rb_spain" android:id="@+id/am_rb_spain" /> <RadioButton android:layout_width="wrap_content"...

jQuery - Radio Buttons - Variables - OnClick

javascript,jquery,radio-button
I have a table of data on the right that starts out with certain values and is modified through the use of radio buttons and a slider on the left. I would like the first radio button for the "pay in full" option to increase the estimated discount on the...

Select table from database with radio buttons

php,pdo,radio-button
I need to select a table from the database based on the radio button that has been selected. The way I thought this would work is, 1) by determining what radio-button has been selected in an if-statement and assigning it a variable; and, 2) assigning that variable to the $dbname...

How to keep only one radio button selected with React

radio-button,reactjs
Im trying to learn React by doing a small application with it. My application has two radio buttons and I would like to keep always only one of them checked, but cannot seem to figure out how to uncheck the other button when I select the other one. Instead they...

Validate multiple choice radio buttons with Javascript

javascript,validation,radio-button
I want to prevent the form ( with id="new_question") from being submitted if an answer (radio button) is not checked from that radio group. <input class="radioclass" id="q1a" value="a" name="question[q1correct]" type="radio"> <input class="radioclass" id="q1b" value="b" name="question[q1correct]" type="radio"> <input class="radioclass" id="q1c" value="c" name="question[q1correct]" type="radio"> <input class="radioclass" id="q1d" value="d" name="question[q1correct]" type="radio"> <input id="publishbtn"...

radio box selected item on angularjs

javascript,angularjs,radio-button
i'm wonder how could i set up selected item checked when i'm using radio button list my sample code look like this <div ng-repeat="vehicle in filteredVehicle"> <input type="radio" name="radiog_lite" id="radio_{{$index}}" class="css-checkbox" ng-value="vehicle" ng-model="$parent.selectedVehicle" ng-disabled="vehicle.enable == '0'" /> <label for="radio_{{$index}}" class="css-label radGroup1" ng-if="vehicle.enable == '1'"></label> <h5>{{vehicle.vehicleTypeName}}</h5> below i have created plunker...

How to deal with RadioGroup.SetOnCheckedChangeListener?

c#,android,xamarin,radio-button
public class OnAdicionarEventArgs : EventArgs { private string mNome; private string mPreco; private string mUnidade; private string mCategoria; public string Nome { get{ return mNome; } set{ mNome=value;} } public string Preco { get{ return mPreco; } set{ mPreco=value;} } public string Unidade { get{ return mUnidade; } set{...

AngulaJS add a class to parent for active radiobutton

javascript,html,css,angularjs,radio-button
I'm curious how to add a class to the parent div for the <input type="radio"> for the group of radio buttons? The code is below and JSFiddle is here HTML: <div class="bd"> <input type="radio" ng-model="value" value="foo" ng-change='newValue(value)'></div> <div class="bd active"><input type="radio" ng-model="value" value="bar" ng-change='newValue(value)'></div> <div class="bd"><input type="radio" ng-model="value" value="baz" ng-change='newValue(value)'>...

Radio Button INPUT not sending the input to the PHP code

php,forms,post,radio-button
The code is given below shows the errors : <div class="field form-inline radio"> <form method="post" action=""> <div> <label><input type="radio" name="eatable" value="fruit_in"/> Fruit</label> </div> <div> <label><input type="radio" name="eatable" value="vegetable_in"/> Vegetable</label> </div> <div> <label><input type="radio" name="eatable" value="bread_in"/> Bread</label> </div> <div> <label><input type="radio"...

Selecting Radio Buttons with XPath in C#

c#,selenium,xpath,selenium-webdriver,radio-button
I am trying to select a specific radio button with the XPath command: driver.FindElement(By.XPath("//td[contains(@input id, 'SearchTypePatientNameDob')]")).Click(); The list that contains the button I want is as follows: <tr> <td> <input id="RadioButtonSearchTypePatientNameDob" type="radio" value="SearchTypePatientNameDob" name="SearchType"> <span class="Instructions">Patient Name / Patient Date of Birth</span> </td> </tr> My command can not find the...

Radio button value not inserting into database

javascript,php,html,ajax,radio-button
I have a problem with my radio button value that doesn't get inserted into the database. I'm using ajax so in my PHP file I request for the values and one of them is the radio button that is selected. In my external javascript file, the variable "gender" is assigned...

List of radio inputs with RactiveJS

radio-button,ractivejs
I have a very funny problem with RactiveJS. I know this is the expected behavior, but I cannot see any solution/workaround. Here is the code: http://jsfiddle.net/qsgatse1/2/ The problem comes from this line: <input type='radio' name="{{a}}" value="{{false}}">false In a few words, I have a Ractive object, referencing an array of "sub-ractive"...

Select choice based on what's selected (Radio buttons)

javascript,jquery,html,checkbox,radio-button
Sorry to bother everyone but I'm in a bit of a snag. I'm trying to setup my code to select an item based on the country selected and type of shipping. I can get it to work with just the country but when I try to add they type of...

PHP: Submitting form data via $_POST works for all fields except radio buttons

php,forms,post,radio-button,radio
I am new to PHP and hope someone can help me with this. I have an HTML form with a number of inputs and textareas. On Submit I pass the form to another PHP page that generates an email with its values. For text inputs and textareas everything works as...

Check if radio buttons are set

php,radio-button
In PHP, I want to check if the radio buttons are checked; I do this with isset, but something isn't working. html: <form action="test.php" method="post" name="form_contribute" id="form_contribute"> <fieldset> <legend>Required information</legend> <p>Type of publication</p> <div id="radio_buttons"> <label for="p_book">Book</label> <input type="radio" name="p_radio" id="p_book" value="p_book"> <label for="p_article">Article</label> <input type="radio" name="p_radio"...

Dynamic radio button value 1 checked by default

javascript,jquery,radio-button,radiobuttonlist
I use a code to display some radio buttons, but this code and values are loaded dynamically, so I cannot add checked to the html. The differences between the radio buttons are values. Is there a way to let value 1 be selected by default? Code: <div class="input-box"> <strong><?php echo...

Radio buttons always “false” in params

html,ruby-on-rails,ruby-on-rails-4,radio-button,form-for
I don't understand... The radio button is always returning false, the rest of the form works. I had to put "false" for the third argument for the "radio_button" form_for helper method, however, that shouldn't affect the outcome. Any idea what's going on? <div class="control-group"> <%= f.label :delivery_method, :class => 'control-label...

False the value except the selected radio button using AngularJS

javascript,jquery,angularjs,radio-button
I using radio button within my angular page. The radio button is under the ng-repeat. I want to check the radio default by the json data is true. Then if one radio checked, change the remaining data into be a false. i done it. But radio button is not checked...

How to get selected radio button to display specific hidden div after clicking submit?

javascript,jquery,forms,radio-button
I currently have three radio buttons. I would like the selected radio button to trigger a pop-up div once the submit button is clicked. I originally had an "onclick" jQuery function to popup the corresponding div when the radio button was selected, but I am not sure how to build...

Radio buttons need to stay checked [closed]

php,html,radio-button,joomla3.0
I need to make two radio buttons that stay checked after submission. I am making this inside a Joomla article. I installed DirectPHP so I can use php and javascript. The code i have till now: <form> <input name="button" type="radio" value="1" id="button1" /> <input name="button" type="radio" value="2" id="button2" /> <input...

radiobuttons - test if checked - why do first 2 approaches fail?

c#,radio-button
I was wondering why below did not work as expected... if if-statement changed to (!ctrl.checked) it returns all radio-button's names) myForm f = new myForm(); foreach (RadioButton ctrl in f.Controls.OfType<RadioButton>()) { if (ctrl.Checked) MessageBox.Show(ctrl.Name); } I also tried foreach (Control c in f.controls) if (c is radiobutton) { if (c.Checked)...

Get value from radiobutton and radiogroup android

android,radio-button,eclipse-adt,android-radiogroup,android-radiobutton
// here is my code, but the result still 0...anyone can help to fix my code? thx before :) RadioGroup rg_ringkas, rg_rapi, rg_resik, rg_rawat, rg_rajin; RadioButton r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25; TextView textview_total; public static int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,total; int sum = 0; r1 = (RadioButton) findViewById(R.id.radioButton1); r2 = (RadioButton) findViewById(R.id.radioButton1); r3 = (RadioButton) findViewById(R.id.radioButton1); r4...

How to connect array elements with radio buttons

javascript,arrays,radio-button
I'm trying to make a simple quiz with radio button options. The quiz has one button that should dynamically remove and add the next question, and set of radio buttons. The questions and options stored in separate arrays. I am stuck on trying to connect each option with a radio...

Why does my javascript prevent me from selecting a radio button more than once?

javascript,radio-button
I would like to have a web donation form on my non-profit's website, and I would like people to be able to select a one-time gift or a monthly gift when they give via credit card. If they select a monthly gift, I would need to send some values to...

How do you get a Radio Button to change text color in html with jquery?

javascript,jquery,html,css,radio-button
Here is the code I Have cant figure out how to get the value of the radio button to be read by jquery and then into a function that will then change the color of the text. Code: https://jsfiddle.net/RhnvU/3898/ HTML: <span id="quotechange"> HEllloooooo </span> <div id="mydiv"> Color: <label class="color1"><input type="radio"...

Angular radio buttons are not checked correctly [duplicate]

javascript,angularjs,radio-button
This question already has an answer here: AngularJS: ng-model not binding to ng-checked for checkboxes 2 answers I have two radio buttons, and they should be checked depending on some condition. <input data-ng-checked="user.contract1 || user.contract2" data-ng-model="user.agreed" type="radio" data-ng-value="true"> Yes <input data-ng-checked="!user.contract1 && !user.contract2" data-ng-model="user.agreed" type="radio" data-ng-value="false"> No So here,...

Adding a RadioButton to a itemView adapter within a ListView

listview,arraylist,radio-button,barcode,selecteditem
I wonder if anyone can help with this , please? This Code below is ListView adapter to enable a single itemView to which all works well. Iam able to show with this adapter the barcode number and the time of the item that is read by a barcode reader with...

How do I properly change the values of a Radiobutton?

python,user-interface,tkinter,radio-button
I have created a IntVar() this.v. When this.v = 1, my elif statement is true, which should not be the case. What have I done wrong? When I print(this.v.get()) the value returned is 1. (import tkinter) this.v = IntVar() this.button1 = Radiobutton(this.root,text = "Small Boxes First",variable = this.v,value = 1)...

Changing Font Color of wxpython Radio Button

python,radio-button,wxpython
I am using wxpython version 2.9.4.0 and python 2.7.9. I am trying the change the color of the text for a radio button. I initialized by: button = wx.RadioButton(panel, -1, 'Line', (200, 300)) I was able to change the color around the radio button by: button.SetBackgroundColour((150, 150, 150)) But this...

How to I display these radio buttons horizontally?

html,css,wordpress,radio-button,woocommerce
I have the following table for product variations from woocommerce. Does someone have an idea how i can display these horizontally? I've looked through several different forums but so far none of my attempts have worked. It concerns the woocommerce product variations. They are being displayed as radio buttons instead...

Binding radio buttons in an ng-repeat with angular

html,angularjs,binding,radio-button,ng-repeat
I'm relatively new to angular and i'm trying to bind my form radio buttons so I can post the data to the back end. My problem is when I try to submit the form, the variable formData doesn't contain any of the information entered in the form. I tried binding...

how to make a loop and if statement that loops through a different groups of radio buttons (javascript)

html,loops,twitter-bootstrap-3,radio-button
**HTML** <li class="option"> <input type="radio" name="Answer1" value="A">A</input><br> <input type="radio" name="Answer1" value="B">B</input><br> <input type="radio" name="Answer1" value="C">C</input><br> <input type="radio" name="Answer1" value="D">D</input><br> </li> <li class="option"> <input type="radio" name="Answer2" value="A">A</input><br> <input type="radio" name="Answer2"...

Radio button group validation of dynamically generated name fields

javascript,jquery,html5,radio-button
CODE: html <form id="myform" type="post"> <fieldset id="myid1"> <input id="entries_8490_burn_id_1" name="entries[8490][burn_id]" value="1" type="radio"/> <input id="entries_8490_burn_id_2" name="entries[8490][burn_id]" value="2" type="radio"/> <input id="entries_8490_burn_id_3" name="entries[8490][burn_id]" value="3" type="radio"/> </fieldset> <fieldset id="myid2"> <input id="entries_8491_burn_id_1" name="entries[8491][burn_id]" value="1" type="radio"/> <input...

Saving results of radio button click in Flask

python,flask,radio-button
The relevant part of my flask code is: @app.route("/process", methods = ["GET", "POST"] ) def process_form(): #checked = request.form.getlist('option') checked=request.form('option') with open('checked.txt','w') as file: file.write("%s"%checked) # do something with checked array return checked and my html looks like: <div class="container" id='tog'> <div class="half"> <form action="/process" method="POST"> <input type="radio" name="option" value="original"...

JavaScript functions messing up my Radio Button displays

javascript,php,jquery,html,radio-button
I created a form which contains two Radio Buttons. Each radio button displays a separate form, when Clicked. When a button is un-clicked, the form disappears from view (it is not shown) I also added a second JavaScript Function, which disables the "SUBMIT" button, if none of the radio buttons...

How to switch jQuery class in HTML based on Radio Button choice

javascript,jquery,html,radio-button
I have a jQuery class that manipulates an image whenever it is applied to it, like this: <div> <img src="cat.jpg" alt="If you can see this, then Javascript may be disabled." class="myJQclass1" /> </div> This works perfectly on its own, however I also have 2 other jQuery classes: myJQclass2 and myJQclass3,...

Radio buttons across forms

html,forms,radio-button
I've got an HTML div composed of many rows (using angular so the number of rows is dynamic). Inside these rows are columns or <td> tags. Inside some of these <td>'s are forms with radio buttons. If a radio button in one form is clicked, I need all the other...

Return span text from selected radio button using JQuery/JavaScript

jquery,html,radio-button,radiobuttonlist
I have a list oif radio buttons of which only one can be checked. I would like to retrieve the values from the selected radio button. I do not seem te get any text in returned alert. Please not that this HTML is generated automatically and therefore I cannot edit...