Opa,
Tenho uns radio buttos que via css são trocados por cores.
<div class="radio-cores">
<input type="radio" name="cor" value="1" />
<label class="product-color-blue"></label>
<input type="radio" name="cor" value="2" />
<label class="product-color-grey"></label>
<input type="radio" name="cor" value="3" />
<label class="product-color-red"></label>
<input type="radio" name="cor" value="4" />
<label class="product-color-green"></label>
</div>
O CSs
.radio-cores input[type="radio"] {
display: none;
}
.radio-cores label {
display: inline-block;
color:#fff;
padding: 4px 11px;
font-family: Arial;
font-size: 16px;
cursor: pointer;
margin:3px;
border:1px solid #cecece
}
Só que ao enviar o post, o radio button selecionado não vem, se remover a classe radio-cores
da div, eles vem no post normalmente.
.radio-cores input[type="radio"] {
display: none;
}
.radio-cores label {
display: inline-block;
color:#fff;
padding: 4px 11px;
font-family: Arial;
font-size: 16px;
cursor: pointer;
margin:3px;
border:1px solid #cecece
}
.product-color-blue {
background-color: blue;
}
.product-color-grey {
background-color: grey;
}
.product-color-red {
background-color: red;
}
.product-color-green {
background-color: green;
}
<form method="post" action="salva.php" enctype="multipart/form-data">
<div class="radio-cores">
<input type="radio" name="cor" value="1" />
<label class="product-color-blue"></label>
<input type="radio" name="cor" value="2" />
<label class="product-color-grey"></label>
<input type="radio" name="cor" value="3" />
<label class="product-color-red"></label>
<input type="radio" name="cor" value="4" />
<label class="product-color-green"></label>
</div>
</form>