Manish Tiwari Manish Tiwari - 1 year ago 77
jQuery Question

How to get values of radio button if they are disabled using Jquery in Codeigniter?

In Application, i have group of question and answer. Every question has 3 set of answer that type are radio button.all question and answer in form. if i answer any question and click on next button then that question's answer will disabled.
Right now i disabled it on next but at the last when i click on submit.then i am getting all values from


Script Code :

<script type="text/javascript">
$('.forward').click(function(event) {
$('input[type=radio]:checked').each(function(index, el) {
var title = $(this).attr('name');


In Codeigniter Code :

function insertValues() {
$answer = $this->input->post();

Html Code:

<form method="post" action="http://localhost/demo/insertValues">

<h3>Question 1 ?</h3>
<input name="1" type="radio" value="111">
<input name="1" type="radio" value="112">
<input name="1" type="radio" value="113">

<h3>Question 2 ?</h3>
<input name="2" type="radio" value="121">
<input name="2" type="radio" value="122">
<input name="2" type="radio" value="123">

<button type="button" name="forward" class="forward">Save &amp; Next</button>

<button type="submit" name="submit" class="submit">See Report</button>

Answer Source

One possibility is to enable them in a submit event handler

    $('form').on('submit', function(){
        $(this).find(':radio').prop('disabled', false);