I'm using [jq-idealforms](https://github.com/elclanrs/jq-idealforms) to build a nice and easy form. In It i have a radio-field that i would like to fill with jquery after getted info from db. [Here](http://elclanrs.github.io/jq-idealforms/) there an example (at "step2".. section 2) you can watch how jq-ideal and radio-field work.
It doesn't provide an api to do that, but if i can fill an input[type='text'] element whit jquery, it must be possible whit radio-field too. 

You can look [here](https://github.com/elclanrs/jq-idealforms/blob/master/js/src/radiocheck.js#L24), how jq-idealforms manages radio-field.

I have tryed with the follow part of code:

```
  $(this).prop('checked', true);
  $(this).next().addClass('checked');

```

where $(this) is one of the 3 radio-field, and it is the one which i want select (rest of code [is on the example](http://elclanrs.github.io/jq-idealforms/)):

```
  <input type="radio" name="radio" style="position: absolute; left: -9999px;" autocomplete="off">

```

The class "checked" is not putted in the element span.ideal-radio (sibling of input). I'm sure of the DOM, because if i use another class like "foo", this one is added. I think that is a bug from plugin, but what? how i can solve?

And at the and i reload form like explained on documentation:
 $(form).data('idealforms').reload().fresh();

Textarea elements and input text type are filled correctly.

Edit:

The problems is more simple, i can't select the first element of my radio checkbox if jq-idealforms is enabled, if i don't use jq-idealforms, the first radio element is selected. Or if you put "checked" on the second radio-element and you use jq-idealforms, it works too.

```
<html>
<head>
    <script src="js/lib/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" href="css/jquery.idealforms.min.css" media="screen"/>
    <script src="js/lib/jquery.idealforms.min.js"></script> <!-- removing it work -->
<head>
<body>
    <form id="form-doc" method="post" action="">
    <div>
        <label>Tipo doc:</label> 
        <input type="text" name="tipo_doc" />
    </div>
    <div>
        <label>Ruolo ditta:</label> 
        <label> 
            <input type="radio" name="ruolo_ditta" checked/>Fornitore
        </label> 
        <label> 
            <input type="radio" name="ruolo_ditta" /> Cliente
        </label>
    </div>
    <div>
        <button type="submit">Salva</button>
        <button id="reset" type="button">Reset</button>
    </div>
    </form>
    <script type="text/javascript">
    var options = {
        onFail: function() {alert( 'fail');},
        onSuccess: function() {alert( 'succes');},
        inputs: {
            'tipo_doc' : {
                filters: 'required min max',
                data: { min: 3, max: 16 },
            }, 
            'ruolo_ditta' : {
                filters: 'required min',
                data: { min: 1 },
            }, 
        }
    };
    var myform = $('#form-doc').idealforms(options).data('idealforms');
    $('#reset').click(function(){
        myform.reset().fresh().focusFirst();
    });
    myform.focusFirst();
</script>`
</body>
</html>

```

It doesn't work with jquery-1.9.1 and jquery-1.10.1.

SOLUTION:

Documentation is wrong for radio button. You can read on [site](https://github.com/elclanrs/jq-idealforms#required):

> 
> required
> 
> 
> The field is required. This filter ONLY works with text inputs (text,
>  password, textarea). For select use exclude to exclude the default
>  option. **For radio and checkbox use min: 1 which will require at least
>  one option to be checked.**
> 
> 
> 

But using:

```
'ruolo_ditta' : {
    filters: 'min',
    data: { min: 1 },
}

```

or combinated whit 'required' filters (or only required filter) on idealforms option, where "ruolo\_ditta" is the value of attribute name of radio elements. The form make a wrong and realy strange behavior. 

Deleting it, using checked on the first radio html element works good and 

```
$(this).prop('checked', true).trigger('change'); 

```

works as aspected. 

thanks,
j.