Hi,
I am using the Dialog.confirm function from Prototype.
Let me explain what I do.
First, I have a link to Add a Memo in the layout (in order to be always
present) :
<?php echo $html->link('Add a memo','#', array('onclick' =>
'add_memo(<?php echo $user_id; ?>);')) ?>
This link call the Dialog.confirm function and load a form.
function add_memo(id) {
Dialog.confirm($('addmemo').innerHTML, {
className:"alphacube", width:500,
okLabel: "Submit", cancelLabel: "Close",
onOk:function(win){
if($('memotitle').value == '' ||
$('memodesc').value == '') {
$('response').innerHTML='Please fill the
<b>Title</b> and the <b>Description</b>';
$('response').show();
}else{
new
Ajax.Request("ajax-add-memo.php?id="+id+"&title="+$('memotitle').value+"&desc="+$('memodesc').value,
{ method:'GET', contentType:'application/x-www-form-urlencoded' });
}
Windows.focusedWindow.updateHeight();
new
Effect.Shake(Windows.focusedWindow.getId()); return false;}});
}
I am using a PHP file : ajax-add-memo.php (which is in my /webroot)
because the user is able to add a Memo in all the web site, whatever the
controller or the view.
This PHP file is a basic file with code to save the data in the database.
_The problem_ :
When the user submits the form, sometimes the data are not saved.
It depends of the controller.
Actually, when the user navigate in the website, when he is positioned
on some controllers, the save in the database does not work.
I have 7 controllers, and for 2 of them, the user could not add a memo.
He will have to change of page and find a good one to save the data.
_My question_ :
Is there something to do or to not do when you use "new Ajax.Request" ?
Because I don't see a big difference in my 7 controllers.
Thanks for your help.
--
Pierre
[EMAIL PROTECTED]
_____________________
CableOrganizer.com
5610 NW 12th Ave, suite 214
Ft.Lauderdale, FL 33309
Phone: 954-861-6310
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---