Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AJAX field with the same name as persistent parameter behaves unpredictible #33

Closed
rostenkowski opened this issue Aug 8, 2014 · 11 comments

Comments

Projects
None yet
5 participants
@rostenkowski
Copy link
Contributor

commented Aug 8, 2014

When u try to send an form via AJAX with the field named the same as a persistent parameter, application will try to save that value to the persistent state although the form has been sent by the POST method and it's fields have NOTHING to do with the persistent state.

Interesting is that within normal POST (non AJAX) this is not happening.

Workaround is to name those fields with some different names.

@JanTvrdik

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2014

That's because in AJAX requires Nette does not differentiate between POST a GET parameters.

@rostenkowski

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2014

Who requires it? Whether it is AJAX or not is irrelevant, isn't it? POST data should be separated from query string parameters.

@Majkl578

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2014

This is an issue of nette/application, not nette/forms, see here.

@JanTvrdik: Is that in some RFC or something?

@rostenkowski

This comment has been minimized.

Copy link
Contributor Author

commented Aug 15, 2014

@JanTvrdik I can't find any material about joining GET and POST parameters in AJAX. Can u please provide some link?

@fprochazka

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2014

@Majkl578

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2014

@fprochazka: I already provided link to that, but @JanTvrdik should provide reference for "AJAX requires Nette". I don't think AJAX requires such thing in any way.

@fprochazka

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2014

@Majkl578 that was most likely typo and I don't see how bashing @JanTvrdik about making a typo helps to resolve this issue.

@Majkl578

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2014

To be honest, I was not sure whether it was a typo or not and I was curious if it is something real or not. But the only reason I came up with was easiness to use with jQuery's $.get/$.post. No bashing.

@rostenkowski

This comment has been minimized.

Copy link
Contributor Author

commented Aug 15, 2014

I am not sure what typo are u talking about... if @JanTvrdik meant that "Nette requires it..." there is no point to continue with that discussion...

So what about make this real (documented) feature?

Why join only the GET and the POST parameters and only in AJAX?

What about to join the parameters always and remove Request::getPost() method? We have no getPut() neither getDelete() methods.

This is IMHO the way to be more HTTP method independent.

What do u think?

@xificurk

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2014

What do u think?

That this is not related to forms at all ;-)

@rostenkowski

This comment has been minimized.

Copy link
Contributor Author

commented Aug 15, 2014

Maybe ;) But some opinions may be valuable :)

@rostenkowski rostenkowski reopened this Aug 15, 2014

dg added a commit to dg/nette-application that referenced this issue Apr 1, 2016

dg added a commit to dg/nette-application that referenced this issue Apr 1, 2016

dg added a commit to dg/nette-application that referenced this issue Apr 1, 2016

dg added a commit to dg/nette-application that referenced this issue Apr 16, 2016

dg added a commit to nette/application that referenced this issue Apr 30, 2016

dg added a commit to nette/application that referenced this issue Apr 30, 2016

dg added a commit to nette/application that referenced this issue Apr 30, 2016

dg added a commit to nette/application that referenced this issue May 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.