Thanks a lot for clarifying my doubts. You were indeed helpful.

On Monday, December 15, 2014 9:02:45 PM UTC+5:30, Anthony wrote:
>
> Given your code, I would expect the browser warning after successful 
> submission whether or not it was preceded by an earlier form validation 
> error.
>
> Also, note that when you hit the back button, it is not a GET request -- 
> rather, it is a repeat of the previous request (which in this case was a 
> POST request, which is what causes the warning -- you are asking the 
> browser to repeat an earlier POST request).
>
> Anthony
>
> On Monday, December 15, 2014 9:18:11 AM UTC-5, Ramashish Gaurav wrote:
>>
>> Dear Anthony,
>>
>> Thanks for your response.
>>
>> I am planning to implement your advice to redirect to the same form 
>> submission page, with a link for redirecting to other page after form 
>> submission. In case of an issue, I'll let you know. 
>>
>> However one thing is still unclear to me. Yeh, you indeed figured out a 
>> solution to prevent ERR_CACHE_MISS, but why does it occurs only after 
>> submission of a wrong entry followed by submission of correct entry, and 
>> not in the case of submitting a correct entry right at the first attempt of 
>> form submission?
>>
>> I do understand that clicking browsers back button is a GET request which 
>> in my case tries to retrieve a form made for POST request, thus creating an 
>> error.
>>
>> On Sunday, December 14, 2014 10:32:51 PM UTC+5:30, Anthony wrote:
>>>
>>> Ideally, hitting the back button in the browser after a form submission 
>>> is not a common workflow in your app. If it is, you probably need to come 
>>> up with an alternative.
>>>
>>> Using a GET request is not a good idea if POST is the appropriate HTTP 
>>> verb (e.g., if submitting the form results in changes on the server, you 
>>> don't want to use a GET request, which might be repeated without warning 
>>> when hitting the back button). An alternative is to simply do a redirect 
>>> back to the same page right after successful form submission (possibly 
>>> followed by another redirect to the "other" page if necessary). The 
>>> redirect back to the same page will cause the page to load a blank form via 
>>> GET before the ultimate redirect, so if the back button is hit, it will 
>>> reload the GET request rather than the previous POST request.
>>>
>>> Anthony
>>>
>>> On Sunday, December 14, 2014 7:49:26 AM UTC-5, Ramashish Gaurav wrote:
>>>>
>>>> Thanks for the response.
>>>>
>>>> So can we remove this warning while still using SQLFORM.factory() ? . 
>>>> Actually in this mailing list, I read one post regarding the same error, 
>>>> where a form was generated via HTML and "method" was set as "get" instead 
>>>> of "post", to remove the same warning. You may wanna go through this post:
>>>>
>>>>
>>>> https://groups.google.com/forum/?hl=en#!searchin/web2py/ERR_CACHE_MISS/web2py/iqpamJNOvn4/h12NBjBXCvQJ
>>>>
>>>> Perhaps I have to change the way of form generation and submission. 
>>>> Please take a look into it.
>>>>
>>>> On Sunday, December 14, 2014 6:07:30 PM UTC+5:30, Niphlod wrote:
>>>>>
>>>>> it's standard behaviour for modern browsers. You can't go back to 
>>>>> something that was generated by a POST (the form submission) without a 
>>>>> warning, because it's like having the form submitted twice (POST isn't 
>>>>> idempotent).
>>>>>
>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to