unable to choose the radio option

Encountering an unusual problem with the radio buttons due to custom styling. The issue arises when trying to select certain options. Here is the jsfiddle link for reference: http://jsfiddle.net/bm6Lfhdz/1/

Attempt to choose 'Yes' from the second question or 'option 1' from the Fifth question. Clicking on them seems unresponsive. Can anyone help identify what might be incorrect in the code?

The customized CSS being utilized:

div.questions {
margin-bottom: 12px;
border: 1px dotted #fafafa;
padding: 25px 20px;
position: relative;
margin-bottom: 20px;
}

input[type='radio'] {
 display: none;
 cursor: pointer;
}
input[type='radio']:focus, input[type='radio']:active{
  outline: none;
 }
input[type='radio']:hover + label:hover {
  color: #fff; 
}
input[type='radio'] + label {
 cursor: pointer;
 display: inline-block;
 position: relative;
 padding-left: 25px;
  margin-right: 10px;
 color: #0b4c6a;
}
input[type='radio'] + label:before, input[type='radio'] + label:after{
 content: '';
 font-family: helvetica;
 display: inline-block;
 width: 18px;
 height: 18px;
 left: 0;
 bottom: 0;
 text-align: center;
 position: absolute;
 }
input[type='radio'] + label:before {
 background-color: #fafafa;
 -moz-transition: all 0.05s ease-in-out;
 -o-transition: all 0.05s ease-in-out;
 -webkit-transition: all 0.05s ease-in-out;
 transition: all 0.05s ease-in-out;
}
input[type='radio'] + label:after {
 color: #fff;
}
input[type='radio']:checked + label:before {
 -moz-box-shadow: inset 0 0 0 10px #4DD26D;
 -webkit-box-shadow: inset 0 0 0 10px #4DD26D;
 box-shadow: inset 0 0 0 10px #4DD26D;  
}

/*Radio Specific styles*/
input[type='radio'] + label:before {
 -moz-border-radius: 50%;
 -webkit-border-radius: 50%;
 border-radius: 50%;
}
 input[type='radio'] + label:hover:after, input[type='radio']:checked + label:after {
 content: "\2713";
 line-height: 18px;
 font-size: 14px; 
 }
 }
 input[type='radio'] + label:hover:after {
  color: #c7c7c7;
 }
 input[type='radio']:checked + label:after, input[type='radio']:checked + label:hover:after {
 color: #fff;
 }

Appreciate any assistance,

Please test all options as there have been instances of erratic behavior with the radio button selection.

Answer №1

Each set of questions has the same ID values for their corresponding <input> elements. It is essential in HTML for the IDs to be distinct on the page.

The confusion likely arises because the browser assumes that since id="radio1" was already assigned, there is no need to select it again, even when referring to a different element.

To resolve this issue, ensure that all input fields have unique ID attributes.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Personalized hover effect using CSS on Caldera Forms

Struggling to customize the CSS style of my Caldera forms on a WordPress site. My goal is to add a hover effect to the radio checklist fields. Currently, I've only managed to style the bullets and need help adding a hover effect to the fields themselv ...

I'm looking to adjust the position of an image inside a div without affecting the position of the entire div

When creating a horizontal navigation bar with an image, I encountered an issue where the image link did not align with the rest of the links on the navigation bar. I wanted to drop it down by a pixel or two without affecting the position of the other link ...

A JavaScript code snippet to format a phone number in the pattern xx-xxxxxx

Please help me create a JavaScript function that can determine if the text in a textbox is a number. If it's not a number, I would like the function to focus on the textbox and change the format to look like this (xx-xxxxxx) when numbers are typed in, ...

Safari not fully supporting CSS translate functionality

When I click a button on my app, an element slides into view and then slides out when I click the button again. This is achieved using a combination of CSS and JS. It works perfectly in Chrome and Firefox, but only partially in Safari. In Safari, the elem ...

Ways to prevent the repetition of keys associated with values

I am currently dealing with an array called serialNumbers, which can have different structures. For example: lot: 1 Serial: 2 lot: 1 Serial: 3 lot: 1 Serial: 4 ...or it could look like this: lot: 1 Serial: 5 lot: 1 Serial: 9 lot: 8 Serial: 2 lot: ...

What could be causing the issue of not being able to load CSS files or images?

I'm currently in the process of learning how to develop websites, but I've encountered a stumbling block that I can't seem to overcome. I'm hoping someone here can help me out. I'm facing an issue where I am unable to link either a ...

Embracing the power of dynamic imports in Next.js 10 with SDK integration for

I attempted to dynamically import the TRTC SDK using Next.js 10: const TRTC = dynamic(() => import('trtc-js-sdk').then((module) => module.NamedExport), { ssr: false }); However, I encountered an error stating "TRTC.createClient is not a co ...

Is it possible to incorporate variables when updating an array or nested document in a mongodb operation?

Within the "myCollection" target collection, there exists a field named "japanese2". This field is an array or an object that contains another object with a property called "japanese2a", initially set to 0 but subject to change. My goal is to update this p ...

Assign characteristics to the button, however it will only activate after being clicked twice

The button I created with some bootstrap attributes is not working properly on the first click. To resolve this, I initially called the function in onload and then again on the button click. However, I am now unable to do so and am seeking alternative solu ...

Mastering Instagram Automation: Techniques for Navigating the Lightbox with Selenium

I am in the process of developing a Python script that assists users in Instagram engagement groups by efficiently liking everyone's photo during each round. I am facing an issue where Selenium is unable to click on the first photo when I reach a user ...

Searching in real-time with ajax in CodeIgniter framework is a seamless and efficient process

I'm a beginner in CodeIgniter and eager to learn. Currently, I'm facing an issue where the data is not being populated on the search page. In the model: function fetch_data($query) { $this->db->select('*'); $this-> ...

Magical Stylist - Eradicate Indicators while Preserving Labeling

Recently, I've been experimenting with the Google styling wizard in an effort to remove markers while retaining labels for businesses. My objective is to eliminate the marker icons but still display the text labels such as "Jimmy Johns," "Boone Saloon ...

Angular service provided by MetronicApp

I've been working on integrating Angular services with the Metronic App. This is how I defined my service: angular.module('MetronicApp').service('shaperService', ['$http', function ($http) { this.shapers = function(param ...

Is there a way to change a weather api into local time using ReactJS/JavaScript?

In order to display time in a specific format like 12:00 or 20:00 and change the background with images, I need to convert it to local time. This is essential for achieving my desired output. The JSON data structure that I am working with looks as follow ...

Typescript is throwing an error when trying to use MUI-base componentType props within a custom component that is nested within another component

I need help customizing the InputUnstyled component from MUI-base. Everything works fine during runtime, but I am encountering a Typescript error when trying to access the maxLength attribute within componentProps for my custom input created with InputUnst ...

Retrieve information from the API prior to rendering the controller components

Hello there! I am looking to retrieve data from a factory before any of my controllers are loaded. After some research, I discovered that it can be achieved using the resolve function in AngularJS: angular.module('agent', ['ngRoute',&a ...

How can I retrieve data from local storage based on a specific key value using a query?

In order to optimize the storage of data for my app, I have successfully stored a large amount in local storage. Now, I am faced with the task of fetching data in an array but only selecting key/values that are specifically chosen, rather than all or jus ...

Angular - Automatically update array list once a new object is added

Currently, I'm exploring ways to automatically update the ngFor list when a new object is added to the array. Here's what I have so far: component.html export class HomePage implements OnInit { collections: Collection[]; public show = t ...

Utilize D3 to Rotate Text within an SVG in Circular Motion, Following by Self-rotation

In my visualization, the labels are arranged around the center of a circle by rotation. However, this results in the labels on the left side of the circle appearing upside down. Is there a way to rotate the labels on the left side independently after the i ...

Converting numerical elements in an array to strings

Looking for assistance with reformatting the values in this Array : [{abcd:1, cdef:7},{abcd:2, cdef:8}, {abcd:3, cdef:9}] I want to convert all the values into strings like so : [{abcd:"1", cdef:"7"},{abcd:"2", cdef:"8"}, {abcd:"3", cdef:"9"}] Can anyo ...