Monday, March 1, 2010

Re: Jquery thick box closing problem

I know how to close thickbox.


$(document).ready(function(){
function tb_remove() {
$("#TB_imageOff").unbind("click");
$("#TB_closeWindowButton").unbind("click");
$("#TB_window").fadeOut("fast",function(){$
('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
$("#TB_load").remove();
if (typeof document.body.style.maxHeight == "undefined") {if IE 6
$("body","html").css({height: "auto", width: "auto"});
$("html").css("overflow","");
}
document.onkeydown = "";
document.onkeyup = "";
return false;
}
})

now I want to after submit data run above jquery.

function admin_add() {
$this->layout = 'ajax';

if (!empty($this->data)) {
if($this->data['User']['password'] == $this->Auth-
>password($this->data['User']['password_confirm'])){
$this->User->create();
if ($this->User->save($this->data)) {
#after save user data
$this->data['UserProfile']['user_id'] = $this-
>User->id;
#save userprofile data
if($this->User->UserProfile->save($this->data)){

$this->flashSuccess('The user has been
saved',array('controller'=>'users','action'=>'index'));

}else{
$this->flashWarning('The user could not be
saved. Please, try again.');
}
}else {
$this->flashWarning('The user could not be saved. Please,
try again.');
}
}

I want to run only when user save only. how to run javascript code
inside cakephp controller?
}
#set branch list
$branches = $this->User->Branch->find('list');
$this->set(compact('branches'));

}

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: