does not take the current value

31 views
Skip to first unread message

squall

unread,
Sep 13, 2012, 9:55:39 AM9/13/12
to cer...@googlegroups.com
Hello

I have the following problem, I'm trying to send an Ajax request but values ​​are not updated I mean

function ceraboxInit(){ 

$('preview').cerabox({

    ajax: {
      url:'component/artevent/?task=preview&format=raw',
      type: 'post', 
      data: 'email='+$('email').value
     
    },
    group: false,
    width: 480,
    height: 390,
    displayTitle: false, 
    
  }).fireEvent('click');  
 
   
};


<input  onclick="ceraboxInit()" type="button" id="preview" class="preview">

But when sending email says that the variable takes the value is empty when the page was loaded but not the current


Cera media

unread,
Sep 14, 2012, 6:14:04 AM9/14/12
to cer...@googlegroups.com
Hi Squall,

Have you got a page online where we can check this out?

Anyway the way I would do it is:

// Add CeraBox the #preview
$('preview').cerabox({

    ajax: {
      url:'component/artevent/?task=preview&format=raw',
      type: 'post', 
      data: 'email='
     
    },
    group: false,
    width: 480,
    height: 390,
    displayTitle: false, 
    
  });

// onclick
function ceraboxInit(){
    var box = $('preview').retrieve('cerabox');
    box.options.ajax.data = 'email='+$('email').getValue();
    box.fireEvent('click');
}

I didn't test this but I hope it gets you in the right direction. Good luck!

Cheers
Reply all
Reply to author
Forward
0 new messages