I am having problems with ajax observeField on a checkbox thats not
working in IE7. It works fine in firefox, and safari. I have run
Fiddler HTTP Proxy on my windows machine to see whether a request was
being made when I clicked the checkbox and it appears that nothing is
happening. I am running cake_1.2.1.8004 with script.aculo.us 1.8.2.
Here is my appropriate code for reference:
The controller method for the ajax call:
function load_sites($cat_id) {
if(!empty($cat_id)) {
if (!$this->Session->check('selectedCategory.' .
$cat_id)) {
$sites = $this->Site->find('all',
array('conditions' => array
('Site.category_id = ' . $cat_id)));
$this->set('sites', $sites);
$this->set('do', 'set');
$this->set('cat', $cat_id);
$this->Session->write('selectedCategory.' .
$cat_id, '1');
} else {
$this->Session->delete('selectedCategory.' .
$cat_id);
$this->set('do', 'unset');
$this->set('cat', $cat_id);
}
}
}
The form:
echo $form->checkbox('cat[' . $cat['Category']['id'] . ']',
array
('class' => 'catCheckbox',
'id' => 'cat[' .
$cat['Category']['id'] . ']'
));
echo '<label for="cat[' . $cat['Category']['id'] . ']">' . $cat
['Category']['name'] . '</label>';
echo '<br />';
// sites ajax junk
echo $ajax->div('sites' . $cat['Category']['id']);
echo $ajax->divEnd('sites' . $cat['Category']['id']);
$options = array('url' => 'load_sites/' .
$cat['Category']['id'],
'update' => 'sites' .
$cat['Category']['id']);
echo $ajax->observeField('cat[' . $cat['Category']['id'] . ']',
$options);
My controller has the RequestHandler controller.
As I said above, this works in firefox and safari, so I *should* have
everything setup correctly. I really dont know where to look anymore.
Am i missing a little tweak I need for IE?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---