Hello,
Try this:
<form onSubmit="return false;" name="form" id="form">
<?php
print $form->input('Tag/tags');
print $form->input('scene_id',array('type'=>'hidden', 'value' =>
$scene['Scene']['id']));
print $ajax->observeForm('form', array('update' => 'items', 'url' =>
'/scenes_tags/addajax', 'frequency' => '0.1'));
?>
</form>
<div id="items">
<?php
foreach ($scene['Tag'] as $row) {
print '<div class="task" id="done_' . $row['ScenesTag']['id'] . '" title="'
. $row['ScenesTag']['id'] . '">';
print $row['name'] . " ";
print $ajax->link('Delete', '/scenes_tags/deleteajax/' .
$row['ScenesTag']['id'], array('update'=>'items','after' => 'new
Effect.Fade(\'done_' . $row['ScenesTag']['id'] . '\')'));
print '</div>' . "\n";
}
?>
</div>
Andras Kende
http://www.kende.com
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Dovdimus Prime
Sent: Thursday, May 15, 2008 12:15 PM
To: CakePHP
Subject: Submitting an ajax form using a drop down list
Hi all
I've got a ajax->form with buttons on it which submit the form just
fine and produce the expected behaviour.
I've just added a drop down list (i.e. select element) to the form and
tried to get its onchange event to submit the form using:
onchange = submit();
However, I find that although the form's action does generate the
appropriate html, it shows it on a new page rather than loading it
into the target div.
Does Cake provide a simple way of getting a drop down list to submit
an ajax->form?
Thanks
David
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---