RE: POST form changes to PUT

2013-05-10 Thread Advantage+
I am an idiot.

 

It was my textarea / editor forcing the PUT!

 

Sorry for the problem but thanks all the same to those who helped along the way 
J

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
Irvin Huang
Sent: Thursday, May 09, 2013 11:20 AM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

and how about "POST vs PUT".

 

I think there is a good answer on this page

http://stackoverflow.com/questions/630453/put-vs-post-in-rest

 

 

Irvin Huang  於 2013/5/9 下午9:43 寫道:





According to CakePHP > lib > Cake > View > Helper > FormHelper.php

 

Look up to this function 

public function create($model = null, $options = array())

 

and the following is the conditions the FormHelper will change PUT to POST:

 

1. Either $this->request->data[ the model name same as you specified for 
$this->Form->create(… ]  doesn't exist OR you do pass "action" value to 
$this->Form->create.

 

2. $this->request->data[MODEL NAME]['id'] doesn't exist.

 

my thought:

I think CakePHP has been clearly these things POST and PUT.  You saving new 
record by POST and modifying by PUT.

 

 

Advantage+  於 2013/5/9 上午6:40 寫道:





I will see what I can find out tonight and sure to share any results.

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
André Luis
Sent: Wednesday, May 08, 2013 6:28 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

Maybe a ghost chaning it´s value everytime you are not looking at...

 

If you find why it´s happening please share here, because i have same issue 
sometimes...


Em quarta-feira, 8 de maio de 2013 17h29min54s UTC-3, advantage+ escreveu:

I am same, 2.3.4

 

It works fine as I stated in every form except just this one.

 

Nothing special just allows user to edit the profile data. Name / country / bio 
and sent to the same js function as every other form on the site. Every form as 
you noted has that hidden div and all point to _post except this 1 form gets 
changed to _put.

 

It is not the functionality that has me puzzled, its figuring out why just this 
form. I know I can do the post || put in the controller but rather figure out 
why this is happening rather than just side track it with extra params in the 
controller since it should not be needed.

 

Will look thru everything again see if there is something over looked….

 

Thanks,

 

Dave

 

From:   cake...@googlegroups.com [mailto:  
cake...@googlegroups.com] On Behalf Of André Luis
Sent: Wednesday, May 08, 2013 5:48 PM
To:   cake...@googlegroups.com
Subject: Re: POST form changes to PUT

 

What is your CakePHP core version? I´ve tested on 2.3.4 here and worked fine. 
Also i´m under PHP 5.4, check your PHP version too (But i think there is no 
reason for not working)

Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:

I have it hardcoded like that for this form. Still goes to PUT.

 

From:  <mailto:cake...@googlegroups.com> cake...@googlegroups.com  
<mailto:[mailto:cake...@googlegroups.com]> [mailto:cake...@googlegroups.com] On 
Behalf Of Mancho
Sent: Wednesday, May 08, 2013 9:17 AM
To:  <mailto:cake...@googlegroups.com> cake...@googlegroups.com
Subject: Re: POST form changes to PUT

 

Actually with option type you can change the hardcoded method.

 

echo $this->Form->create('User', array('type' => 'post'));




Murgan, Alexis Germán
Desarrollador & Diseñador
Web:  <http://german.murgan.com.ar/> german.murgan.com.ar
Email:  <mailto:ger...@murgan.com.ar> ger...@murgan.com.ar
MSN:  <mailto:ger...@murgan.com.ar> ger...@murgan.com.ar
Móvil: +5493424663813

 

2013/5/8 André Luis < <mailto:cava...@live.com> cava...@live.com>

What if you create a hidden field " 
$this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in 
your form?? It should override the other one



Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms thru 
the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') && 
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms 
using this js function and all of the forms and all are set up the exact same 
way / Form->helper standard in

RE: POST form changes to PUT

2013-05-09 Thread Advantage+
I also did read that in the book.

 

But in this case I went thru the site last night and found 10 forms that will 
all update an existing record. 

Basically user goes to a page (edit profile) and all the info is populated in 
the form / ajax submit saved alert. Pretty basic. 

All the forms submit the same, all thru the same javascript (method : POST) but 
the profile page changes to PUT.

 

Cake does not change any of the other forms, just my edit/profile. 
$this->Form->create('User', array(………..)) Form->end() all that tasty goodness.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
Irvin Huang
Sent: Thursday, May 09, 2013 11:13 AM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

According to CakePHP > lib > Cake > View > Helper > FormHelper.php

 

Look up to this function 

public function create($model = null, $options = array())

 

and the following is the conditions the FormHelper will change PUT to POST:

 

1. Either $this->request->data[ the model name same as you specified for 
$this->Form->create(… ]  doesn't exist OR you do pass "action" value to 
$this->Form->create.

 

2. $this->request->data[MODEL NAME]['id'] doesn't exist.

 

my thought:

I think CakePHP has been clearly these things POST and PUT.  You saving new 
record by POST and modifying by PUT.

 

 

Advantage+  於 2013/5/9 上午6:40 寫道:





I will see what I can find out tonight and sure to share any results.

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
André Luis
Sent: Wednesday, May 08, 2013 6:28 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

Maybe a ghost chaning it´s value everytime you are not looking at...

 

If you find why it´s happening please share here, because i have same issue 
sometimes...


Em quarta-feira, 8 de maio de 2013 17h29min54s UTC-3, advantage+ escreveu:

I am same, 2.3.4

 

It works fine as I stated in every form except just this one.

 

Nothing special just allows user to edit the profile data. Name / country / bio 
and sent to the same js function as every other form on the site. Every form as 
you noted has that hidden div and all point to _post except this 1 form gets 
changed to _put.

 

It is not the functionality that has me puzzled, its figuring out why just this 
form. I know I can do the post || put in the controller but rather figure out 
why this is happening rather than just side track it with extra params in the 
controller since it should not be needed.

 

Will look thru everything again see if there is something over looked….

 

Thanks,

 

Dave

 

From:   cake...@googlegroups.com [mailto:  
cake...@googlegroups.com] On Behalf Of André Luis
Sent: Wednesday, May 08, 2013 5:48 PM
To:   cake...@googlegroups.com
Subject: Re: POST form changes to PUT

 

What is your CakePHP core version? I´ve tested on 2.3.4 here and worked fine. 
Also i´m under PHP 5.4, check your PHP version too (But i think there is no 
reason for not working)

Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:

I have it hardcoded like that for this form. Still goes to PUT.

 

From:  <mailto:cake...@googlegroups.com> cake...@googlegroups.com  
<mailto:[mailto:cake...@googlegroups.com]> [mailto:cake...@googlegroups.com] On 
Behalf Of Mancho
Sent: Wednesday, May 08, 2013 9:17 AM
To:  <mailto:cake...@googlegroups.com> cake...@googlegroups.com
Subject: Re: POST form changes to PUT

 

Actually with option type you can change the hardcoded method.

 

echo $this->Form->create('User', array('type' => 'post'));




Murgan, Alexis Germán
Desarrollador & Diseñador
Web:  <http://german.murgan.com.ar> german.murgan.com.ar
Email:  <mailto:ger...@murgan.com.ar> ger...@murgan.com.ar
MSN:  <mailto:ger...@murgan.com.ar> ger...@murgan.com.ar
Móvil: +5493424663813

 

2013/5/8 André Luis < <mailto:cava...@live.com> cava...@live.com>

What if you create a hidden field " 
$this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in 
your form?? It should override the other one



Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms thru 
the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') && 
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is chang

Re: POST form changes to PUT

2013-05-09 Thread Irvin Huang
and how about "POST vs PUT".

I think there is a good answer on this page
http://stackoverflow.com/questions/630453/put-vs-post-in-rest


Irvin Huang  於 2013/5/9 下午9:43 寫道:

> According to CakePHP > lib > Cake > View > Helper > FormHelper.php
> 
> Look up to this function 
> public function create($model = null, $options = array())
> 
> and the following is the conditions the FormHelper will change PUT to POST:
> 
> 1. Either $this->request->data[ the model name same as you specified for 
> $this->Form->create(… ]  doesn't exist OR you do pass "action" value to 
> $this->Form->create.
> 
> 2. $this->request->data[MODEL NAME]['id'] doesn't exist.
> 
> my thought:
> I think CakePHP has been clearly these things POST and PUT.  You saving new 
> record by POST and modifying by PUT.
> 
> 
> Advantage+  於 2013/5/9 上午6:40 寫道:
> 
>> I will see what I can find out tonight and sure to share any results.
>>  
>> Dave
>>  
>> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf 
>> Of André Luis
>> Sent: Wednesday, May 08, 2013 6:28 PM
>> To: cake-php@googlegroups.com
>> Subject: Re: POST form changes to PUT
>>  
>> Maybe a ghost chaning it´s value everytime you are not looking at...
>>  
>> If you find why it´s happening please share here, because i have same issue 
>> sometimes...
>> 
>> Em quarta-feira, 8 de maio de 2013 17h29min54s UTC-3, advantage+ escreveu:
>> I am same, 2.3.4
>>  
>> It works fine as I stated in every form except just this one.
>>  
>> Nothing special just allows user to edit the profile data. Name / country / 
>> bio and sent to the same js function as every other form on the site. Every 
>> form as you noted has that hidden div and all point to _post except this 1 
>> form gets changed to _put.
>>  
>> It is not the functionality that has me puzzled, its figuring out why just 
>> this form. I know I can do the post || put in the controller but rather 
>> figure out why this is happening rather than just side track it with extra 
>> params in the controller since it should not be needed.
>>  
>> Will look thru everything again see if there is something over looked….
>>  
>> Thanks,
>>  
>> Dave
>>  
>> From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf 
>> Of André Luis
>> Sent: Wednesday, May 08, 2013 5:48 PM
>> To: cake...@googlegroups.com
>> Subject: Re: POST form changes to PUT
>>  
>> What is your CakePHP core version? I´ve tested on 2.3.4 here and worked 
>> fine. Also i´m under PHP 5.4, check your PHP version too (But i think there 
>> is no reason for not working)
>> 
>> Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:
>> I have it hardcoded like that for this form. Still goes to PUT.
>>  
>> From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf 
>> Of Mancho
>> Sent: Wednesday, May 08, 2013 9:17 AM
>> To: cake...@googlegroups.com
>> Subject: Re: POST form changes to PUT
>>  
>> Actually with option type you can change the hardcoded method.
>>  
>> echo $this->Form->create('User', array('type' => 'post'));
>> 
>> Murgan, Alexis Germán
>> Desarrollador & Diseñador
>> Web: german.murgan.com.ar
>> Email: ger...@murgan.com.ar
>> MSN: ger...@murgan.com.ar
>> Móvil: +5493424663813
>>  
>> 
>> 2013/5/8 André Luis 
>> What if you create a hidden field " 
>> $this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in 
>> your form?? It should override the other one
>> 
>> 
>> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>> Running into a weird issue where my form as rendered the HTML shows:
>>  
>> > method="post" action="/manage/profile">
>>  
>> This form is submitted using ajax and the function is used by many forms 
>> thru the site:
>> $.ajax({
>> type: "POST",
>> url: $(sel).attr('action'),
>> data: $(sel).formSerialize(),
>> dataType: 'json',
>>  
>> And in the controller I have if($this->request->is('ajax') && 
>> ($this->request->is('post'))
>>  
>> But it fails on this 1 form because for some reason it is 

Re: POST form changes to PUT

2013-05-09 Thread Irvin Huang
According to CakePHP > lib > Cake > View > Helper > FormHelper.php

Look up to this function 
public function create($model = null, $options = array())

and the following is the conditions the FormHelper will change PUT to POST:

1. Either $this->request->data[ the model name same as you specified for 
$this->Form->create(… ]  doesn't exist OR you do pass "action" value to 
$this->Form->create.

2. $this->request->data[MODEL NAME]['id'] doesn't exist.

my thought:
I think CakePHP has been clearly these things POST and PUT.  You saving new 
record by POST and modifying by PUT.


Advantage+  於 2013/5/9 上午6:40 寫道:

> I will see what I can find out tonight and sure to share any results.
>  
> Dave
>  
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf 
> Of André Luis
> Sent: Wednesday, May 08, 2013 6:28 PM
> To: cake-php@googlegroups.com
> Subject: Re: POST form changes to PUT
>  
> Maybe a ghost chaning it´s value everytime you are not looking at...
>  
> If you find why it´s happening please share here, because i have same issue 
> sometimes...
> 
> Em quarta-feira, 8 de maio de 2013 17h29min54s UTC-3, advantage+ escreveu:
> I am same, 2.3.4
>  
> It works fine as I stated in every form except just this one.
>  
> Nothing special just allows user to edit the profile data. Name / country / 
> bio and sent to the same js function as every other form on the site. Every 
> form as you noted has that hidden div and all point to _post except this 1 
> form gets changed to _put.
>  
> It is not the functionality that has me puzzled, its figuring out why just 
> this form. I know I can do the post || put in the controller but rather 
> figure out why this is happening rather than just side track it with extra 
> params in the controller since it should not be needed.
>  
> Will look thru everything again see if there is something over looked….
>  
> Thanks,
>  
> Dave
>  
> From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf Of 
> André Luis
> Sent: Wednesday, May 08, 2013 5:48 PM
> To: cake...@googlegroups.com
> Subject: Re: POST form changes to PUT
>  
> What is your CakePHP core version? I´ve tested on 2.3.4 here and worked fine. 
> Also i´m under PHP 5.4, check your PHP version too (But i think there is no 
> reason for not working)
> 
> Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:
> I have it hardcoded like that for this form. Still goes to PUT.
>  
> From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf Of 
> Mancho
> Sent: Wednesday, May 08, 2013 9:17 AM
> To: cake...@googlegroups.com
> Subject: Re: POST form changes to PUT
>  
> Actually with option type you can change the hardcoded method.
>  
> echo $this->Form->create('User', array('type' => 'post'));
> 
> Murgan, Alexis Germán
> Desarrollador & Diseñador
> Web: german.murgan.com.ar
> Email: ger...@murgan.com.ar
> MSN: ger...@murgan.com.ar
> Móvil: +5493424663813
>  
> 
> 2013/5/8 André Luis 
> What if you create a hidden field " 
> $this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in 
> your form?? It should override the other one
> 
> 
> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
> Running into a weird issue where my form as rendered the HTML shows:
>  
>  method="post" action="/manage/profile">
>  
> This form is submitted using ajax and the function is used by many forms thru 
> the site:
> $.ajax({
> type: "POST",
> url: $(sel).attr('action'),
> data: $(sel).formSerialize(),
> dataType: 'json',
>  
> And in the controller I have if($this->request->is('ajax') && 
> ($this->request->is('post'))
>  
> But it fails on this 1 form because for some reason it is changing to PUT.
>  
> Are there reason why this would be happening? I looked at a few of my forms 
> using this js function and all of the forms and all are set up the exact same 
> way / Form->helper standard inputs / selects.
>  
> I even added into the form with issues 'method' => 'POST' (upper and lower) 
> but it still fires off a PUT request. Renders as POST but inspecting the 
> request shows:
>  
> application/x-www-form-urlencoded
> _methodPUT
>  
> Ideas would be welcome.
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http:/

RE: POST form changes to PUT

2013-05-08 Thread Advantage+
I will see what I can find out tonight and sure to share any results.

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of André Luis
Sent: Wednesday, May 08, 2013 6:28 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

Maybe a ghost chaning it´s value everytime you are not looking at...

 

If you find why it´s happening please share here, because i have same issue
sometimes...


Em quarta-feira, 8 de maio de 2013 17h29min54s UTC-3, advantage+ escreveu:

I am same, 2.3.4

 

It works fine as I stated in every form except just this one.

 

Nothing special just allows user to edit the profile data. Name / country /
bio and sent to the same js function as every other form on the site. Every
form as you noted has that hidden div and all point to _post except this 1
form gets changed to _put.

 

It is not the functionality that has me puzzled, its figuring out why just
this form. I know I can do the post || put in the controller but rather
figure out why this is happening rather than just side track it with extra
params in the controller since it should not be needed.

 

Will look thru everything again see if there is something over looked….

 

Thanks,

 

Dave

 

From: cake...@googlegroups.com 
[mailto:cake...@googlegroups.com  ] On Behalf Of André Luis
Sent: Wednesday, May 08, 2013 5:48 PM
To: cake...@googlegroups.com  
Subject: Re: POST form changes to PUT

 

What is your CakePHP core version? I´ve tested on 2.3.4 here and worked
fine. Also i´m under PHP 5.4, check your PHP version too (But i think there
is no reason for not working)

Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:

I have it hardcoded like that for this form. Still goes to PUT.

 

From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf
Of Mancho
Sent: Wednesday, May 08, 2013 9:17 AM
To: cake...@googlegroups.com
Subject: Re: POST form changes to PUT

 

Actually with option type you can change the hardcoded method.

 

echo $this->Form->create('User', array('type' => 'post'));




Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

 

2013/5/8 André Luis 

What if you create a hidden field "
$this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in
your form?? It should override the other one



Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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+u...@googlegroups.com.
To post to this group, send email to cake...@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.
 
 

 

-- 
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+u...@googlegroups.com.
To post to this group, send email to cake...@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.
 
 

-- 
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 st

Re: POST form changes to PUT

2013-05-08 Thread André Luis
Maybe a ghost chaning it´s value everytime you are not looking at...

If you find why it´s happening please share here, because i have same issue 
sometimes...

Em quarta-feira, 8 de maio de 2013 17h29min54s UTC-3, advantage+ escreveu:
>
> I am same, 2.3.4
>
>  
>
> It works fine as I stated in every form except just this one.
>
>  
>
> Nothing special just allows user to edit the profile data. Name / country 
> / bio and sent to the same js function as every other form on the site. 
> Every form as you noted has that hidden div and all point to _post except 
> this 1 form gets changed to _put.
>
>  
>
> It is not the functionality that has me puzzled, its figuring out why just 
> this form. I know I can do the post || put in the controller but rather 
> figure out why this is happening rather than just side track it with extra 
> params in the controller since it should not be needed.
>
>  
>
> Will look thru everything again see if there is something over looked….
>
>  
>
> Thanks,
>
>  
>
> Dave
>
>  
>
> *From:* cake...@googlegroups.com  [mailto:
> cake...@googlegroups.com ] *On Behalf Of *André Luis
> *Sent:* Wednesday, May 08, 2013 5:48 PM
> *To:* cake...@googlegroups.com 
> *Subject:* Re: POST form changes to PUT
>
>  
>
> What is your CakePHP core version? I´ve tested on 2.3.4 here and worked 
> fine. Also i´m under PHP 5.4, check your PHP version too (But i think there 
> is no reason for not working)
>
> Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:
>
> I have it hardcoded like that for this form. Still goes to PUT.
>
>  
>
> *From:* cake...@googlegroups.com [mailto:cake...@googlegroups.com] *On 
> Behalf Of *Mancho
> *Sent:* Wednesday, May 08, 2013 9:17 AM
> *To:* cake...@googlegroups.com
> *Subject:* Re: POST form changes to PUT
>
>  
>
> Actually with option type you can change the hardcoded method.
>
>  
>
> echo $this->Form->create('User', array('type' => 'post'));
>
>
> Murgan, Alexis Germán
> Desarrollador & Diseñador
> Web: german.murgan.com.ar
> Email: ger...@murgan.com.ar
> MSN: ger...@murgan.com.ar
> Móvil: +5493424663813
>
>  
>
> 2013/5/8 André Luis 
>
> What if you create a hidden field " 
> $this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " 
> in your form?? It should override the other one
>
>
>
> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
> Running into a weird issue where my form as rendered the HTML shows:
>
>  
>
>
>  method="post" action="/manage/profile">
>
>  
>
> This form is submitted using ajax and the function is used by many forms 
> thru the site:
>
> $.ajax*({*
>
> **type: "POST",
>
> url: $*(*sel*)*.attr*(*'action'*)*,
>
> data: $*(*sel*)*.formSerialize*()*,
>
> dataType: 'json',
>
>  
>
> And in the controller I have if($this->request->is('ajax') && ($this->
> request->is('post'))
>
>  
>
> But it fails on this 1 form because for some reason it is changing to PUT.
>
>  
>
> Are there reason why this would be happening? I looked at a few of my 
> forms using this js function and all of the forms and all are set up the 
> exact same way / Form->helper standard inputs / selects.
>
>  
>
> I even added into the form with issues 'method' => 'POST' (upper and 
> lower) but it still fires off a PUT request. Renders as POST but inspecting 
> the request shows:
>
>  
>
> application/x-www-form-urlencoded
>
> _methodPUT
>
>  
>
> Ideas would be welcome.
>
> -- 
> 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+u...@googlegroups.com.
> To post to this group, send email to cake...@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.
>  
>  
>
>  
>
> -- 
> 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

RE: POST form changes to PUT

2013-05-08 Thread Advantage+
I am same, 2.3.4

 

It works fine as I stated in every form except just this one.

 

Nothing special just allows user to edit the profile data. Name / country /
bio and sent to the same js function as every other form on the site. Every
form as you noted has that hidden div and all point to _post except this 1
form gets changed to _put.

 

It is not the functionality that has me puzzled, its figuring out why just
this form. I know I can do the post || put in the controller but rather
figure out why this is happening rather than just side track it with extra
params in the controller since it should not be needed.

 

Will look thru everything again see if there is something over looked….

 

Thanks,

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of André Luis
Sent: Wednesday, May 08, 2013 5:48 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

What is your CakePHP core version? I´ve tested on 2.3.4 here and worked
fine. Also i´m under PHP 5.4, check your PHP version too (But i think there
is no reason for not working)

Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:

I have it hardcoded like that for this form. Still goes to PUT.

 

From: cake...@googlegroups.com 
[mailto:cake...@googlegroups.com  ] On Behalf Of Mancho
Sent: Wednesday, May 08, 2013 9:17 AM
To: cake...@googlegroups.com  
Subject: Re: POST form changes to PUT

 

Actually with option type you can change the hardcoded method.

 

echo $this->Form->create('User', array('type' => 'post'));




Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar  
MSN: ger...@murgan.com.ar  
Móvil: +5493424663813

 

2013/5/8 André Luis  >

What if you create a hidden field "
$this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in
your form?? It should override the other one



Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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+u...@googlegroups.com  .
To post to this group, send email to cake...@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.
 
 

 

-- 
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+u...@googlegroups.com  .
To post to this group, send email to cake...@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.
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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 f

Re: POST form changes to PUT

2013-05-08 Thread André Luis
What is your CakePHP core version? I´ve tested on 2.3.4 here and worked 
fine. Also i´m under PHP 5.4, check your PHP version too (But i think there 
is no reason for not working)

Em quarta-feira, 8 de maio de 2013 14h58min21s UTC-3, advantage+ escreveu:
>
> I have it hardcoded like that for this form. Still goes to PUT.
>
>  
>
> *From:* cake...@googlegroups.com  [mailto:
> cake...@googlegroups.com ] *On Behalf Of *Mancho
> *Sent:* Wednesday, May 08, 2013 9:17 AM
> *To:* cake...@googlegroups.com 
> *Subject:* Re: POST form changes to PUT
>
>  
>
> Actually with option type you can change the hardcoded method.
>
>  
>
> echo $this->Form->create('User', array('type' => 'post'));
>
>
> Murgan, Alexis Germán
> Desarrollador & Diseñador
> Web: german.murgan.com.ar
> Email: ger...@murgan.com.ar 
> MSN: ger...@murgan.com.ar 
> Móvil: +5493424663813
>
>  
>
> 2013/5/8 André Luis >
>
> What if you create a hidden field " 
> $this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " 
> in your form?? It should override the other one
>
>
>
> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
> Running into a weird issue where my form as rendered the HTML shows:
>
>  
>
>
>  method="post" action="/manage/profile">
>
>  
>
> This form is submitted using ajax and the function is used by many forms 
> thru the site:
>
> $.ajax*({*
>
> **type: "POST",
>
> url: $*(*sel*)*.attr*(*'action'*)*,
>
> data: $*(*sel*)*.formSerialize*()*,
>
> dataType: 'json',
>
>  
>
> And in the controller I have if($this->request->is('ajax') && ($this->
> request->is('post'))
>
>  
>
> But it fails on this 1 form because for some reason it is changing to PUT.
>
>  
>
> Are there reason why this would be happening? I looked at a few of my 
> forms using this js function and all of the forms and all are set up the 
> exact same way / Form->helper standard inputs / selects.
>
>  
>
> I even added into the form with issues 'method' => 'POST' (upper and 
> lower) but it still fires off a PUT request. Renders as POST but inspecting 
> the request shows:
>
>  
>
> application/x-www-form-urlencoded
>
> _methodPUT
>
>  
>
> Ideas would be welcome.
>
> -- 
> 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+u...@googlegroups.com .
> To post to this group, send email to cake...@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.
>  
>  
>
>  
>
> -- 
> 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+u...@googlegroups.com .
> To post to this group, send email to cake...@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.
>  
>  
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: POST form changes to PUT

2013-05-08 Thread Advantage+
I have it hardcoded like that for this form. Still goes to PUT.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Mancho
Sent: Wednesday, May 08, 2013 9:17 AM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

Actually with option type you can change the hardcoded method.

 

echo $this->Form->create('User', array('type' => 'post'));




Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

 

2013/5/8 André Luis 

What if you create a hidden field "
$this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " in
your form?? It should override the other one



Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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
<mailto:cake-php%2bunsubscr...@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.
 
 

 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-08 Thread Mancho
Hmmm, maybe in version 2.1.x the option has different key. You can check
this looking in CakePHP libraries.

Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813


2013/5/8 André Luis 

> Lol, this one didnt work for me in version 2.1.something, but now in 2.3.4
> is working fine, tnx
>
> Em quarta-feira, 8 de maio de 2013 08h46min55s UTC-3, Mancho Murgan
> escreveu:
>>
>> Actually with option type you can change the hardcoded method.
>>
>> echo $this->Form->create('User', array('type' => 'post'));
>>
>> Murgan, Alexis Germán
>> Desarrollador & Diseñador
>> Web: german.murgan.com.ar
>> Email: ger...@murgan.com.ar
>> MSN: ger...@murgan.com.ar
>> Móvil: +5493424663813
>>
>>
>> 2013/5/8 André Luis 
>>
>>> What if you create a hidden field " $this->Form->hidden('_method',**
>>> array('name'=>'_method','**value'=>'POST')) " in your form?? It should
>>> override the other one
>>>
>>>
>>> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+
>>> escreveu:
>>>
 Running into a weird issue where my form as rendered the HTML shows:



 



 This form is submitted using ajax and the function is used by many
 forms thru the site:

 $.ajax*({*

 **type: "POST",

 url: $*(*sel*)*.attr*(*'action'*)*,

 data: $*(*sel*)*.formSerialize*()*,

 dataType: 'json',



 And in the controller I have if($this->request->is('ajax') && ($this->
 request->is('post'))



 But it fails on this 1 form because for some reason it is changing to
 PUT.



 Are there reason why this would be happening? I looked at a few of my
 forms using this js function and all of the forms and all are set up the
 exact same way / Form->helper standard inputs / selects.



 I even added into the form with issues 'method' => 'POST' (upper and
 lower) but it still fires off a PUT request. Renders as POST but inspecting
 the request shows:



 application/x-www-form-**urlenco**ded

 _methodPUT



 Ideas would be welcome.

>>>  --
>>> 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+u...@**googlegroups.com.
>>> To post to this group, send email to cake...@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
>>> .
>>>
>>>
>>>
>>
>>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-08 Thread André Luis
Lol, this one didnt work for me in version 2.1.something, but now in 2.3.4 
is working fine, tnx

Em quarta-feira, 8 de maio de 2013 08h46min55s UTC-3, Mancho Murgan 
escreveu:
>
> Actually with option type you can change the hardcoded method.
>
> echo $this->Form->create('User', array('type' => 'post'));
>
> Murgan, Alexis Germán
> Desarrollador & Diseñador
> Web: german.murgan.com.ar
> Email: ger...@murgan.com.ar 
> MSN: ger...@murgan.com.ar 
> Móvil: +5493424663813
>
>
> 2013/5/8 André Luis >
>
>> What if you create a hidden field " 
>> $this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " 
>> in your form?? It should override the other one
>>
>>
>> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ 
>> escreveu:
>>
>>> Running into a weird issue where my form as rendered the HTML shows:
>>>
>>>  
>>>
>>> 
>>>
>>>  
>>>
>>> This form is submitted using ajax and the function is used by many forms 
>>> thru the site:
>>>
>>> $.ajax*({*
>>>
>>> **type: "POST",
>>>
>>> url: $*(*sel*)*.attr*(*'action'*)*,
>>>
>>> data: $*(*sel*)*.formSerialize*()*,
>>>
>>> dataType: 'json',
>>>
>>>  
>>>
>>> And in the controller I have if($this->request->is('ajax') && ($this->
>>> request->is('post'))
>>>
>>>  
>>>
>>> But it fails on this 1 form because for some reason it is changing to 
>>> PUT.
>>>
>>>  
>>>
>>> Are there reason why this would be happening? I looked at a few of my 
>>> forms using this js function and all of the forms and all are set up the 
>>> exact same way / Form->helper standard inputs / selects.
>>>
>>>  
>>>
>>> I even added into the form with issues 'method' => 'POST' (upper and 
>>> lower) but it still fires off a PUT request. Renders as POST but inspecting 
>>> the request shows:
>>>
>>>  
>>>
>>> application/x-www-form-**urlencoded
>>>
>>> _methodPUT
>>>
>>>  
>>>
>>> Ideas would be welcome.
>>>
>>  -- 
>> 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+u...@googlegroups.com .
>> To post to this group, send email to cake...@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.
>>  
>>  
>>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-08 Thread Mancho
Actually with option type you can change the hardcoded method.

echo $this->Form->create('User', array('type' => 'post'));

Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813


2013/5/8 André Luis 

> What if you create a hidden field "
> $this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) "
> in your form?? It should override the other one
>
>
> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
>> Running into a weird issue where my form as rendered the HTML shows:
>>
>>
>>
>> 
>>
>>
>>
>> This form is submitted using ajax and the function is used by many forms
>> thru the site:
>>
>> $.ajax*({*
>>
>> **type: "POST",
>>
>> url: $*(*sel*)*.attr*(*'action'*)*,
>>
>> data: $*(*sel*)*.formSerialize*()*,
>>
>> dataType: 'json',
>>
>>
>>
>> And in the controller I have if($this->request->is('ajax') && ($this->
>> request->is('post'))
>>
>>
>>
>> But it fails on this 1 form because for some reason it is changing to PUT.
>>
>>
>>
>> Are there reason why this would be happening? I looked at a few of my
>> forms using this js function and all of the forms and all are set up the
>> exact same way / Form->helper standard inputs / selects.
>>
>>
>>
>> I even added into the form with issues 'method' => 'POST' (upper and
>> lower) but it still fires off a PUT request. Renders as POST but inspecting
>> the request shows:
>>
>>
>>
>> application/x-www-form-**urlencoded
>>
>> _methodPUT
>>
>>
>>
>> Ideas would be welcome.
>>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-08 Thread André Luis
What if you create a hidden field " 
$this->Form->hidden('_method',array('name'=>'_method','value'=>'POST')) " 
in your form?? It should override the other one

Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
> Running into a weird issue where my form as rendered the HTML shows:
>
>  
>
>  method="post" action="/manage/profile">
>
>  
>
> This form is submitted using ajax and the function is used by many forms 
> thru the site:
>
> $.ajax*({*
>
> **type: "POST",
>
> url: $*(*sel*)*.attr*(*'action'*)*,
>
> data: $*(*sel*)*.formSerialize*()*,
>
> dataType: 'json',
>
>  
>
> And in the controller I have if($this->request->is('ajax') && ($this->
> request->is('post'))
>
>  
>
> But it fails on this 1 form because for some reason it is changing to PUT.
>
>  
>
> Are there reason why this would be happening? I looked at a few of my 
> forms using this js function and all of the forms and all are set up the 
> exact same way / Form->helper standard inputs / selects.
>
>  
>
> I even added into the form with issues 'method' => 'POST' (upper and 
> lower) but it still fires off a PUT request. Renders as POST but inspecting 
> the request shows:
>
>  
>
> application/x-www-form-urlencoded
>
> _methodPUT
>
>  
>
> Ideas would be welcome.
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-07 Thread Jeremy Burns | Class Outfit
I had a similar issue a while back. I can't find the reference now, but I'm 
sure I read an article that confirmed that in some cases the helper creates a 
PUT rather than a POST. The only reference I can see now is 
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#creating-forms 
that states it's a POST on create and a PUT on edit (read the second 'output'; 
"Since this is an edit form, a hidden input field is generated to override the 
default HTTP method."). Could that be what's happening in your case?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 7 May 2013, at 21:17:40, "Advantage+"  wrote:

> Right I understand all that, thanks.
>  
> My question is more about why Cake is changing 1 of the forms to PUT when 
> it's set as POST.
> All forms are created using the Html helper, all forms have the same  1 
> hidden input which all show up with _method = post in the hidden div on all 
> form, all run thru the same jQuery submit function yet 1 form somehow is 
> getting converted to PUT.
>  
> I have deleted records so there is no existing record to PUT so it should be 
> POST, no matter what this 1 form will not accept POST.
>  
> There must be 50 forms / users / admin to add edit data and all use the same 
> function, same js, all have the 1 hidden field, all go to POST except 1 form. 
> This is what puzzles me since it is just the one form. Not so much the 
> functionality of the POST vs PUT but rather why just this 1 form.
>  
> Thanks,
>  
> Dave
>  
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf 
> Of André Luis
> Sent: Tuesday, May 07, 2013 4:06 PM
> To: cake-php@googlegroups.com
> Subject: Re: POST form changes to PUT
>  
> The "PUT" method is when you are updating something, but cake doesnt really 
> uses the put method, but a hidden field with "PUT" as value... So when you 
> have a populated data, even if you´re not updating but creating, it will 
> recognize as PUT
>  
> But both methods will get submited as well, and will have the same data 
> structure, so you can work with both "PUT" or "POST" method the same way, all 
> you need to do is to check not only if the request is "post" but also check 
> if the request is "put"
> 
> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
> Running into a weird issue where my form as rendered the HTML shows:
>  
>  method="post" action="/manage/profile">
>  
> This form is submitted using ajax and the function is used by many forms thru 
> the site:
> $.ajax({
> type: "POST",
> url: $(sel).attr('action'),
> data: $(sel).formSerialize(),
> dataType: 'json',
>  
> And in the controller I have if($this->request->is('ajax') && 
> ($this->request->is('post'))
>  
> But it fails on this 1 form because for some reason it is changing to PUT.
>  
> Are there reason why this would be happening? I looked at a few of my forms 
> using this js function and all of the forms and all are set up the exact same 
> way / Form->helper standard inputs / selects.
>  
> I even added into the form with issues 'method' => 'POST' (upper and lower) 
> but it still fires off a PUT request. Renders as POST but inspecting the 
> request shows:
>  
> application/x-www-form-urlencoded
> _methodPUT
>  
> Ideas would be welcome.
> -- 
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
> 
> -- 
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: POST form changes to PUT

2013-05-07 Thread Advantage+
Right I understand all that, thanks.

 

My question is more about why Cake is changing 1 of the forms to PUT when
it's set as POST.

All forms are created using the Html helper, all forms have the same  1
hidden input which all show up with _method = post in the hidden div on all
form, all run thru the same jQuery submit function yet 1 form somehow is
getting converted to PUT.

 

I have deleted records so there is no existing record to PUT so it should be
POST, no matter what this 1 form will not accept POST.

 

There must be 50 forms / users / admin to add edit data and all use the same
function, same js, all have the 1 hidden field, all go to POST except 1
form. This is what puzzles me since it is just the one form. Not so much the
functionality of the POST vs PUT but rather why just this 1 form.

 

Thanks,

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of André Luis
Sent: Tuesday, May 07, 2013 4:06 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

The "PUT" method is when you are updating something, but cake doesnt really
uses the put method, but a hidden field with "PUT" as value... So when you
have a populated data, even if you´re not updating but creating, it will
recognize as PUT

 

But both methods will get submited as well, and will have the same data
structure, so you can work with both "PUT" or "POST" method the same way,
all you need to do is to check not only if the request is "post" but also
check if the request is "put"

Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-07 Thread André Luis
The "PUT" method is when you are updating something, but cake doesnt really 
uses the put method, but a hidden field with "PUT" as value... So when you 
have a populated data, even if you´re not updating but creating, it will 
recognize as PUT

But both methods will get submited as well, and will have the same data 
structure, so you can work with both "PUT" or "POST" method the same way, 
all you need to do is to check not only if the request is "post" but also 
check if the request is "put"

Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
> Running into a weird issue where my form as rendered the HTML shows:
>
>  
>
>  method="post" action="/manage/profile">
>
>  
>
> This form is submitted using ajax and the function is used by many forms 
> thru the site:
>
> $.ajax*({*
>
> **type: "POST",
>
> url: $*(*sel*)*.attr*(*'action'*)*,
>
> data: $*(*sel*)*.formSerialize*()*,
>
> dataType: 'json',
>
>  
>
> And in the controller I have if($this->request->is('ajax') && ($this->
> request->is('post'))
>
>  
>
> But it fails on this 1 form because for some reason it is changing to PUT.
>
>  
>
> Are there reason why this would be happening? I looked at a few of my 
> forms using this js function and all of the forms and all are set up the 
> exact same way / Form->helper standard inputs / selects.
>
>  
>
> I even added into the form with issues 'method' => 'POST' (upper and 
> lower) but it still fires off a PUT request. Renders as POST but inspecting 
> the request shows:
>
>  
>
> application/x-www-form-urlencoded
>
> _methodPUT
>
>  
>
> Ideas would be welcome.
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: POST form changes to PUT

2013-05-07 Thread Advantage+
Not sure I follow.

 

I have everything as POST, but the 1 form changes automatically to PUT for
some reason. This is what I am trying to figure out. The JS / AJAX is POST
but in the controller as I stated if $this->request->is('post') and
somewhere along the way it changes to PUT then that form will never get
submitted.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of André Luis
Sent: Tuesday, May 07, 2013 9:42 AM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

If you´re sending the data via AJAX, what is the difference between the
hidden fields method be PUT or POST? the data will be sent via AJAX as POST
anyway...

Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-07 Thread André Luis
LOL, i didnt saw that he is sending the whole data as serializied data, so 
it sends the PUT method too...

The solution:

if($this->request->is('ajax') && ($this->request->is('post') || 
$this->request->is('put')){
 //Here you do the magic
}


Em terça-feira, 7 de maio de 2013 09h20min05s UTC-3, Mancho Murgan escreveu:
>
> Hi André Luis, 
>
> That is correct, the AJAX request method is POST, but CakePHP uses an 
> harcoded "method" using an hidden input on form and use this value to 
> validate on controller.
>
> Murgan, Alexis Germán
> Desarrollador & Diseñador
> Web: german.murgan.com.ar
> Email: ger...@murgan.com.ar 
> MSN: ger...@murgan.com.ar 
> Móvil: +5493424663813
>
>
> 2013/5/7 André Luis >
>
>> If you´re sending the data via AJAX, what is the difference between the 
>> hidden fields method be PUT or POST? the data will be sent via AJAX as POST 
>> anyway...
>>
>> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ 
>> escreveu:
>>
>>> Running into a weird issue where my form as rendered the HTML shows:
>>>
>>>  
>>>
>>> 
>>>
>>>  
>>>
>>> This form is submitted using ajax and the function is used by many forms 
>>> thru the site:
>>>
>>> $.ajax*({*
>>>
>>> **type: "POST",
>>>
>>> url: $*(*sel*)*.attr*(*'action'*)*,
>>>
>>> data: $*(*sel*)*.formSerialize*()*,
>>>
>>> dataType: 'json',
>>>
>>>  
>>>
>>> And in the controller I have if($this->request->is('ajax') && ($this->
>>> request->is('post'))
>>>
>>>  
>>>
>>> But it fails on this 1 form because for some reason it is changing to 
>>> PUT.
>>>
>>>  
>>>
>>> Are there reason why this would be happening? I looked at a few of my 
>>> forms using this js function and all of the forms and all are set up the 
>>> exact same way / Form->helper standard inputs / selects.
>>>
>>>  
>>>
>>> I even added into the form with issues 'method' => 'POST' (upper and 
>>> lower) but it still fires off a PUT request. Renders as POST but inspecting 
>>> the request shows:
>>>
>>>  
>>>
>>> application/x-www-form-**urlencoded
>>>
>>> _methodPUT
>>>
>>>  
>>>
>>> Ideas would be welcome.
>>>
>>  -- 
>> 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+u...@googlegroups.com .
>> To post to this group, send email to cake...@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.
>>  
>>  
>>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-07 Thread Mancho
Hi André Luis,

That is correct, the AJAX request method is POST, but CakePHP uses an
harcoded "method" using an hidden input on form and use this value to
validate on controller.

Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813


2013/5/7 André Luis 

> If you´re sending the data via AJAX, what is the difference between the
> hidden fields method be PUT or POST? the data will be sent via AJAX as POST
> anyway...
>
> Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
>> Running into a weird issue where my form as rendered the HTML shows:
>>
>>
>>
>> 
>>
>>
>>
>> This form is submitted using ajax and the function is used by many forms
>> thru the site:
>>
>> $.ajax*({*
>>
>> **type: "POST",
>>
>> url: $*(*sel*)*.attr*(*'action'*)*,
>>
>> data: $*(*sel*)*.formSerialize*()*,
>>
>> dataType: 'json',
>>
>>
>>
>> And in the controller I have if($this->request->is('ajax') && ($this->
>> request->is('post'))
>>
>>
>>
>> But it fails on this 1 form because for some reason it is changing to PUT.
>>
>>
>>
>> Are there reason why this would be happening? I looked at a few of my
>> forms using this js function and all of the forms and all are set up the
>> exact same way / Form->helper standard inputs / selects.
>>
>>
>>
>> I even added into the form with issues 'method' => 'POST' (upper and
>> lower) but it still fires off a PUT request. Renders as POST but inspecting
>> the request shows:
>>
>>
>>
>> application/x-www-form-**urlencoded
>>
>> _methodPUT
>>
>>
>>
>> Ideas would be welcome.
>>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-07 Thread André Luis
If you´re sending the data via AJAX, what is the difference between the 
hidden fields method be PUT or POST? the data will be sent via AJAX as POST 
anyway...

Em segunda-feira, 6 de maio de 2013 15h47min55s UTC-3, advantage+ escreveu:
>
> Running into a weird issue where my form as rendered the HTML shows:
>
>  
>
>  method="post" action="/manage/profile">
>
>  
>
> This form is submitted using ajax and the function is used by many forms 
> thru the site:
>
> $.ajax*({*
>
> **type: "POST",
>
> url: $*(*sel*)*.attr*(*'action'*)*,
>
> data: $*(*sel*)*.formSerialize*()*,
>
> dataType: 'json',
>
>  
>
> And in the controller I have if($this->request->is('ajax') && ($this->
> request->is('post'))
>
>  
>
> But it fails on this 1 form because for some reason it is changing to PUT.
>
>  
>
> Are there reason why this would be happening? I looked at a few of my 
> forms using this js function and all of the forms and all are set up the 
> exact same way / Form->helper standard inputs / selects.
>
>  
>
> I even added into the form with issues 'method' => 'POST' (upper and 
> lower) but it still fires off a PUT request. Renders as POST but inspecting 
> the request shows:
>
>  
>
> application/x-www-form-urlencoded
>
> _methodPUT
>
>  
>
> Ideas would be welcome.
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: POST form changes to PUT

2013-05-06 Thread Advantage+
I see the hidden div you mention on all forms, but they are all POST except
for the 1 form.

 

CHANGES TO PUT:









 

ALL OTHER FORMS RENDER AS POST:









 

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Mancho
Sent: Monday, May 06, 2013 5:11 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

Dude, checks that cakephp adds hidden input with "_method" name and "PUT"
value, and uses this pair name/value for validate.




Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

 

2013/5/6 Advantage+ 

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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
<mailto:cake-php%2bunsubscr...@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.
 
 

 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: POST form changes to PUT

2013-05-06 Thread Advantage+
I did check / read up on that but all my forms have :


echo $this->Form->hidden('lock', array(

 'value' => $lock)); 

 

(lock is similar to the Security form['token'])

 

which is my own version of Security for AJAX / form requests and every
(ajax) form gets sent correct with POST, all but 1 form which is getting
swapped to PUT.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Mancho
Sent: Monday, May 06, 2013 5:11 PM
To: cake-php@googlegroups.com
Subject: Re: POST form changes to PUT

 

Dude, checks that cakephp adds hidden input with "_method" name and "PUT"
value, and uses this pair name/value for validate.




Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

 

2013/5/6 Advantage+ 

Running into a weird issue where my form as rendered the HTML shows:

 



 

This form is submitted using ajax and the function is used by many forms
thru the site:

$.ajax({

type: "POST",

url: $(sel).attr('action'),

data: $(sel).formSerialize(),

dataType: 'json',

 

And in the controller I have if($this->request->is('ajax') &&
($this->request->is('post'))

 

But it fails on this 1 form because for some reason it is changing to PUT.

 

Are there reason why this would be happening? I looked at a few of my forms
using this js function and all of the forms and all are set up the exact
same way / Form->helper standard inputs / selects.

 

I even added into the form with issues 'method' => 'POST' (upper and lower)
but it still fires off a PUT request. Renders as POST but inspecting the
request shows:

 

application/x-www-form-urlencoded

_methodPUT

 

Ideas would be welcome.

-- 
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
<mailto:cake-php%2bunsubscr...@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.
 
 

 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: POST form changes to PUT

2013-05-06 Thread Mancho
Dude, checks that cakephp adds hidden input with "_method" name and "PUT"
value, and uses this pair name/value for validate.

Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813


2013/5/6 Advantage+ 

> Running into a weird issue where my form as rendered the HTML shows:
>
> ** **
>
>  method="post" action="/manage/profile">
>
> ** **
>
> This form is submitted using ajax and the function is used by many forms
> thru the site:
>
> $.ajax*({*
>
> **type: "POST",
>
> url: $*(*sel*)*.attr*(*'action'*)*,
>
> data: $*(*sel*)*.formSerialize*()*,
>
> dataType: 'json',
>
> ** **
>
> And in the controller I have if($this->request->is('ajax') && ($this->
> request->is('post'))
>
> ** **
>
> But it fails on this 1 form because for some reason it is changing to PUT.
> 
>
> ** **
>
> Are there reason why this would be happening? I looked at a few of my
> forms using this js function and all of the forms and all are set up the
> exact same way / Form->helper standard inputs / selects.
>
> ** **
>
> I even added into the form with issues 'method' => 'POST' (upper and
> lower) but it still fires off a PUT request. Renders as POST but inspecting
> the request shows:
>
> ** **
>
> application/x-www-form-urlencoded
>
> _methodPUT
>
> ** **
>
> Ideas would be welcome.
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.