I'm having trouble with box.close() and I don't know why.
On a page I use a multibox (with AJAX) to print an HTML form in a window, I call it like this :
- Code: Select all
<a id="mb_forward" class="mb_forward" rel="width:500,ajax:true" href="mypage.php">test</a>
<script type="text/javascript">
var box_forward = {};
window.addEvent('domready', function(){
box_forward = new MultiBox('mb_forward', {
openFromLink: true,
useOverlay: false,
showControls: false
});
});
</script>
In the page mypage.php I have an HTML FORM which I submit with AJAX with the following code :
- Code: Select all
<script type="text/javascript">
function closeMultibox() {
parent.box.close();
}
$('myForm').addEvent('submit', function(e) {
new Event(e).stop();
this.send({
update: res,
onComplete: function() {
res.removeClass('ajax-loading');
},
onSuccess: function() {
var ret = $('ares').value;
if (ret == 0) {
setTimeout("closeMultibox()", 3000);
}
},
});
});
</script>
Everything works fine except the closeMultibox() function, I get this error :
reference to undefined property this.contentEffects
[Break on this error] this.contentEffects.start({
multibox.js (ligne 479)
this.contentEffects is undefined
[Break on this error] this.contentEffects.start({
And I don't know why
Do you have an idea ?