Ajax with CForm on radio button

Hi all,

I’m a new user of yii framework, my team is involved in development of a big application for tourism based on yii framework.

I’m actualli addressing a strange behaviour in CForm code auto generation.

That’s the element i’m creating:

As you can see the script undelegate a "click" event on a radio button list that lock the correct behaviour of the radio buttons themselfs. In depth it is impossible to check radio in the browser windows, it fires the ajax request but radio stay unchecked.

I was wondering if i could change the triggering event from "click" to something like "change" directly from the CForm element actributes…

Someone got a similar issue?

Best Regards

Emanuele Menon

emware

can’t post my code… the forum suspect a spam message.




jQuery(function($) {

    jQuery('body').undelegate('#SubscriptionForm_is_business_0','click').delegate('#SubscriptionForm_is_business_0','click',function(){

      jQuery.ajax({

        'type':'POST',

        'url':'URL///',

        'cache':false,

        'data':jQuery(this).parents("form").serialize(),

        'success':function(html){

          jQuery("#taxes_div").html(html)

          }

        });

    return false;

    });

  jQuery('body').undelegate('#SubscriptionForm_is_business_1','click').delegate('#SubscriptionForm_is_business_1','click',function(){

    jQuery.ajax({

      'type':'POST',

      'url':'URL///',

      'cache':false,

      'data':jQuery(this).parents("form").serialize(),

      'success':function(html){

        jQuery("#taxes_div").html(html)

        }

      });

  return false;

  });

});