[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread Anthony
> addCategoryForm = FORM('Add category:', > INPUT(_name='category', requires=IS_NOT_EMPTY()), > INPUT(_type='submit')) > if addCategoryForm.accepts(request, session, formname='addCategory'): > try: > create_category(request.vars.category, auth.user.budget_i

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread David Ripplinger
Here is an example form created and handled in the controller's index() function: addCategoryForm = FORM('Add category:', INPUT(_name='category', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if addCategoryForm.accepts(request, session, formname='addCategory'): try:

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread Anthony
It's not quite clear what you're doing -- perhaps you can show a code example. Do you get a lot of users reloading post-submission pages and ignoring the browser warning about re-submitting the form? Anthony On Saturday, April 20, 2013 8:58:54 AM UTC-4, David Ripplinger wrote: > > Furthermore,

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread David Ripplinger
Furthermore, since I am using custom checks on the validity of data (i.e. I'm doing checks that go way beyond putting a "requires" object in a Field object), I am currently creating a custom FORM object, and then after form.accepts passes, I check if adding in the data raises exceptions. If an

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread Niphlod
you can't forge the browser standard behaviour. if the page is the result of a POST, hitting "refresh" will always re-issue a POST. On Saturday, April 20, 2013 2:50:30 PM UTC+2, David Ripplinger wrote: > > How do I make it so that the form does not resubmit upon clicking the > browser reloa

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread David Ripplinger
How do I make it so that the form does not resubmit upon clicking the browser reload button even when the form has errors, but still display the errors? I just hate form resubmissions popping up ever. Nobody ever uses that "feature" of browsers intentionally. On Tuesday, September 28, 2010 12:5

[web2py] Re: stop form from reposting with refresh

2010-09-27 Thread mdipierro
When you say "refresh the page" you mean you "click the reload button". That causes a form re-submission. To prevent it, redirect(URL()) after form.accepts(...) On Sep 27, 11:31 pm, Audra Rudys wrote: > Hi all, > I'm new to web2py and just dipping my toe in with a simple posting form (2 > fields