Saturday, March 17, 2012

Re: JS->Submit

What i learned is that in cake 1.3 the Js->submit button submits the form to the same action of the same controller. So in the controller you will have to check if the request is an ajax request and save the form contents. Hope that would work.

On Saturday, 17 March 2012 14:00:08 UTC+5:30, CrotchFrog wrote:
I recently switched computers and for whatever reason I decided to go with WampServer on this machine instead of XAMPP which I have been using up until now. 

I have a JS request that seems to have stopped working once I switched. 

[code]

<?=$this->Form->create(false);?>
<div class="shopHourDate">
<?php
echo $this->Form->input('date', array(
'label' => false,
'type' => 'date',
'dateFormat' => 'MY',
'minYear' => date('Y'),
'maxYear' => date('Y') + 1,
));
?>
</div>
<div id="go-button">
<?=$this->Js->submit('Go', array('url' => array('action' => 'admin_getWeeks'), 'update' => '#weekList'));?>
<?=$this->Form->end();?>
</div>

[/code]

I'm (relatively) sure that it worked just fine as written above however, now when submitting the form instead of making the request and updating the element #weekList the form submits to 'ShopHours/admin_add'.
I'm sure it's purely coincidence that this occurred at the same time I switched servers but I'm unable to see what I'm overlooking here. 

Thanks in advance, 
ED 

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate