Best way to select Random answer in a Form
<p>I am using the below code to select random answers in a form  </p>

<pre><code>  $('table').filter(function() { return ($(this).find('input').size() &gt; 0); }).find('tr').each(function()
    {
        $(this).find('input').filter(function(){    return (Math.round(Math.random()) == 1);    }).each(function()
        {
            switch(this.type) {
                case 'checkbox':
                case 'radio':
                    this.checked = true;
                    this.trigger('click');
                        break;
                case 'password':
                case 'select-multiple':
                case 'select-one':
                case 'text':
                case 'textarea':
                    $(this).val('12345');
                        break;
            }
        });
    });
</code></pre>

<p>But it is sometimes not answering any input element in a row. Please help me on this.</p>
