hidrau
asked on
How can I check an option of my radiogroup?
Hello
I'd like to have a function where I could pass the name of radio and value so that the function could check the option
Here we have some code
Thanks
I'd like to have a function where I could pass the name of radio and value so that the function could check the option
Here we have some code
<input name="f_tab_4_tipo_frete" type="radio" id="f_tab_4_tipo_frete_0" value="1"/>Emitente
<input name="f_tab_4_tipo_frete" type="radio" id="f_tab_4_tipo_frete_1" value="2"/>Destinatário
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks,
very easy and fast
very easy and fast
function checkRadio( radioName, radioValue ) {
$('input:radio[name=' + radioName + ]').filter('[value=' + radioValue + ']'.attr('checked', true);
}
taken from http://stackoverflow.com/questions/871063/how-to-set-radio-option-checked-onload-with-jquery