Monday, May 6, 2013

cakephp 2x js helper not generating correct code?

<?php echo $this->Form->create('Property',array('id'=>'add_property'));?>
 
<?$data = $this->Js->get('#add_property')->serializeForm(
                                            array(
                                            'isForm' => true,
                                            'inline' => true)
                                                );?>
           <? echo $this->Js->submit('submit.png',
            array('id'=>'submit_id',
                'update' => '#right_side_content', // element to update
                'data'=>$data,
            'before' => $this->Js->get('#submit_busy-indicator')->effect('fadeIn', array('buffer' => false)),
       'complete' => $this->Js->get('#submit_busy-indicator')->effect('fadeOut', array('buffer' => false)),                      
     ));?>
 
 
Generates the following code:
 
$(document).ready(function () {$("#submit_id").bind("click", function (event) {$.ajax({beforeSend:function (XMLHttpRequest) {$("#submit_b
usy-indicator").fadeIn();}, complete:function (XMLHttpRequest, textStatus) {$("#submit_busy-indicator").fadeOut();},
data:$("#submit_id").closest("form").serialize(), dataType:"html", success:function (data, textStatus) {$("#right_side_content").html(dat
a);}, type:"POST", url:"\/cakeapp\/property\/add_property"});
return false;});});
 
Shouldn't this line
"data:$("#submit_id").closest("form").serialize(), dataType:"html","
be
data:$("#add_porperty").closest("form").serialize(), dataType:"html",
 
???

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: