Hi all,
I’m addressing an issue with Ajax attributes declared directly in CForm element, expecially on radiolist element.
When i do it, the resoults is that in the brower radio button seem to not be ceckable, when i click on it it blink, fire the ajax function and then come back to a unchecked state.
There is the involved code from the CForm:
'addressReuse' => array (
'type' => 'radiolist',
'items' => array (0 => 'same', 1 => 'new'),
'label' => 'Invoice address',
'ajax' => array(
'type' => 'POST', //request type
'url' => $controller->createUrl('hotelAutocomplete/addressReuse'), //url to call.
//Style: CController::createUrl('currentController/methodToCall')
'update' => '#taxes_diva', //selector to update
//leave out the data key to pass all form values through
),
And that’s is the auto-generated jquery script in the source of the page:
jQuery('body').undelegate('#SubscriptionForm_is_business_0','click').delegate('#SubscriptionForm_is_business_0','click',function(){
jQuery.ajax({
'type':'POST',
'url':'/wh/hotelAutocomplete/taxesTypes',
'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':'/wh/hotelAutocomplete/taxesTypes',
'cache':false,
'data':jQuery(this).parents("form").serialize(),
'success':function(html){
jQuery("#taxes_div").html(html)
}
});
How can it be solved?