Reputation: 2311
I am using radio button and check box in application I need to change the default style of radio button which is similar to following image,
Gender
<input type="radio" name="gender" id="gender_1" />
<label for="gender_1">Male</label>
<input type="radio" name="gender" id="gender_2" />
<label for="gender_2">Female</label>
From the above code I am getting like this,
But I don't need the button background. I need similar to the following,
In the same manner I need the same out put for check box also ,
Account Status
<input type="radio" name="status" id="status_1" />
<label for="status_1">Non-Resident Indian (NRI)</label>
<input type="radio" name="status" id="status_2" />
<label for="status_2">Person of Indian Origin (PIO)</label>
<input type="radio" name="status" id="status_3" />
<label for="status_3">Oversean Citizen of Indian (OCI)</label>
<input type="radio" name="status" id="status_4" />
<label for="status_4">Foreign Tourist</label>
I don't need background for check box also,
Upvotes: 0
Views: 85
Reputation: 43479
Form elements style is hard to change. Usually when you see not "default" element, it's images with hidden inputs somewhere near and it's values are changed dynamically by jquery/js
Checkbox/Radio:
<div class='fakeCheckbox'><input type='radio' style='display: none;'/></div> // image of radio button
$('.fakeCheckbox').click(function(){
var input = $(this).find('input');
input.attr('checked', !input.attr('checked'))
});
Dropdown:
<div class='fakeDrop'><span></span><select style='opacity: 0; position: absolute; left: 0; topL 0;'></div> // Only opacity, so you can click on it!
$('.fakeDrop > select').change(function(){
$(this).parent().find('span').text($('option:selected', this).text());
});
Upvotes: 1