In my Wordpress plugin that I'm developing, I'm using the WordPress settings api. In the callback that I use to display the setting which contains the radio buttons I enable them and disable them based on a checkbox value. Anyways, I tried to use a hidden input to store their value even though their disabled but that made the situation worse since it always took the value of the last hidden input which in my case was "4".
if(get_option( 'display_style' ) == 2){
$disabled = 'disabled';
}
$html = '<input type="radio" id="onecolumn" class="cardchecked" name="card_columns" value="1"' . checked( 1, get_option( 'card_columns' ), false ) . $disabled . '/>';
$html .= '<input type="hidden" name="card_columns" value="1" />';
$html .= '<label for="onecolumn">One</label>';
$html .= '<input type="radio" id="twoclumn" class="cardchecked" name="card_columns" value="2"' . checked( 2, get_option( 'card_columns' ), false ) . $disabled . '/>';
$html .= '<input type="hidden" name="card_columns" value="2" />';
$html .= '<label for="twoclumn">Two</label>';
$html .= '<input type="radio" id="threecolumn" class="cardchecked" name="card_columns" value="3"' . checked( 3, get_option( 'card_columns' ), false ) . $disabled . '/>';
$html .= '<input type="hidden" name="card_columns" value="3" />';
$html .= '<label for="threecolumn">Three</label>';
$html .= '<input type="radio" id="fourcolumn" class="cardchecked" name="card_columns" value="4"' . checked( 4, get_option( 'card_columns' ), false ) . $disabled . '/>';
$html .= '<input type="hidden" name="card_columns" value="4" />';
$html .= '<label for="fourcolumn">Four</label>';
echo $html;