Re: Cakephp 2.x ajax edit not working in Firefox and Opera

2013-12-19 Thread cake_beginner
im also having this kind of problem.
does anyone know what's wrong with this one?



On Friday, September 14, 2012 6:23:05 AM UTC+8, incognito wrote:
>
> Hi, 
>
> I am basically trying to create an ajax edit form. 
> This is the edit link code 
>
> Js->link('Edit', 
>   array('controller' => 'employees', 'action' => 
> 'personal_details_edit',$employee['Employee']['id']), 
>   array( 
>  'update' => '#personal_details_update', 
>  'evalScripts' => true, 
> 'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', 
> array('buffer' => false)), 
>  'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', 
> array('buffer' => false)), 
>   ) 
>); 
>  echo $this->Js->writeBuffer();   
> ?> 
>
> And this is the ajax form code which gets loaded after clicking the above 
> edit link. 
>
>  //serialize the form element to submit 
>   
> $data = $this->Js->get('#employee_personal_edit')->serializeForm( 
> array( 
> 'isForm' => true, 
> 'inline' => true) 
> ); 
>   
> // Submit the serialize data on submit click 
> $this->Js->get('#employee_personal_edit')->event( 
>   'submit', 
>   $this->Js->request( 
> array('action' => 'personal_details_edit'), 
> array( 
> 'update' => '#personal_details_update', // element to 
> update 
>  // after form submission 
> 'data' => $data, 
> 'async' => true, 
> 'dataExpression'=>true, 
> 'method' => 'POST', 
> 
>   
> ) 
> ) 
> ); 
>  echo $this->Js->writeBuffer(); 
> ?> 
>
>
> The form submit is working in Chrome, IE, Safari but not working in 
> Firefox and Opera.When I click form submit in Firefox nothing happens(no 
> XMLHTTPRequest is being sent). 
>
> If i access the form link directly(without loading via ajax edit link)its 
> working normally in Firefox. 
>
> How to fix it?Any help is appreciated. :)  
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Cakephp without Save() function?

2013-12-19 Thread Domingos Coelho
You can create your insert statement and use the method Query(), but why 
don't you want to use the method Save?

Em quinta-feira, 12 de dezembro de 2013 02h18min56s UTC-4, YOONG SINJIE 
escreveu:
>
> May I know , got other way to store the SQL statement, except the Save() 
> function ? I want to do some simple calculation, i want to store the result 
> at database. Anyone having any idea about it ?
>
> public function add() { if ($this->request->is('post')) {
>
> /// complete calculation 
>
> $data1 = (string) $this->request->data['Calculate']['var1'];
> $data2 = (string) $this->request->data['Calculate']['var2'];
>
> echo $data1;
> echo '';
> echo $data2;
>
> $result = $data1 + $data2;
>
> echo '';
> echo $result;
>
>   SQL Statement
>   mysql_query("INSERT INTO calculate 
> VALUES('$data1','$data2','$result','2')") or die(mysql_error());
>// if($this->Calculate->save($this->request->data)){
>
>// echo'succuful add';
>
>
>// }
> }
>
> }
>
>
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.