Oi Lucas,
este é o meu código:
html:
<tr>
<td>
<label>Sicli Atualizado?</label>
<input type="radio" name="sicli" id="sicli_sim" value="Sim"><span>Sim</span>
<input type="radio" name="sicli" id="sicli_nao" value="Nao" checked><span>Não</span>
<td>
<td>
<div class="lado">
<div>
<label>Seguro Obrigatório?</label>
<input type="radio" name="seguro_ob" id="seguro_ob_sim" value="Sim"><span>Sim</span>
<input type="radio" name="seguro_ob" id="seguro_ob_nao" value="Nao" checked><span>Não</span>
</div>
<div>
<label>Seguro Prestamista?</label>
<input type="radio" name="seguro_prest" id="seguro_prest_sim" value="Sim"><span>Sim</span>
<input type="radio" name="seguro_prest" id="seguro_prest_nao" value="Nao" checked><span>Não</span>
</div>
</div>
<td>
</tr>
jquery:
function Salvar()
{
var strParameters = "";
$(".formulario_sistema :input").each( function()
{
if( $( this ).attr( "obrigatorio" ) == "s" && $( this ).val() == "" )
{
alert("Todos os campos são obrigatórios.");
strParameters = "";
return false;
}
else
{
if($( this ).attr( "name" )=="sicli" || $( this ).attr( "name" )=="seguro_ob" || $( this ).attr( "name" )=="seguro_prest"){
//console.log("--------",$( this ).attr( "checked" ));
if($( this ).attr( "name" ).prop("checked"){
strParameters += "&" + $( this ).attr( "name" ) + "=" + $( this ).val();
}
}else{
strParameters += "&" + $( this ).attr( "name" ) + "=" + $( this ).val();
}
}
alert(strParameters);
}
);
if( strParameters != "" )
{
postar( 'Incluir.php', strParameters, 'conteudo_sistema' );
}
}
php:
if( isset( $POST[ "unidade" ] ) )
{ $POST[ "nome_cliente" ] = trim( $POST[ "nomecliente" ] );
$arrInserir = array
(
"NUM_MAT_CRIADOR" => $_COOKIE["matricula"],
"NUM_UNIDADE" => $_POST[ "unidade" ],
"IDN_TIPO_PROPOSTA" => $_POST[ "tipo" ],
"VLR_PROPOSTA" => $_POST[ "valor" ],
"NUM_CPF_CNPJ" => limpar( $_POST[ "cpf" ] ),
"NOM_SITUACAO" => "CADASTRO EM ANDAMENTO",
"NOM_CLIENTE_PROPOSTA" => str_replace("/", "",strtoupper( removeAcentos( utf8_decode( $_POST[ "nome_cliente" ] ) ) ) ),
//"NUM_AVAL_SIRIC" => $_POST[ "codAvaliacao" ],
//"SIG_RATING" => $_POST[ "rating" ]
"CULTURA" => $_POST[ "cultura" ],
"TX_JUROS" => $_POST[ "tx_juros" ],
"PERC_HIPOTECA" => $_POST[ "perc_hipoteca" ],
"SICLI" => $_POST[ "sicli" ],
"SEGURO_OB" => $_POST[ "seguro_ob" ],
"SEGURO_PREST" => $_POST[ "seguro_prest" ],
"OBS_REDE" => $_POST[ "obs_rede" ]
);