Note, ajax_trap is irrelevant if ajax=True (it just indicates forms should 
be trapped within non-ajax components).

Anthony

On Wednesday, February 17, 2016 at 4:35:43 PM UTC-5, Jim S wrote:
>
> I have them both set to True.  
>
> Anthony - no time yet to package up a sample...  Will see if I can find 
> time tomorrow.
>
> -Jim
>
> On Wednesday, February 17, 2016 at 3:00:39 PM UTC-6, Val K wrote:
>>
>> It seems after first click your form is reloaded, may be there is nested 
>> forms in your html-page or  something else.
>> What does your LOAD-call like? try  ajax=true or  ajax_trap=true 
>>
>>
>> On Wednesday, February 17, 2016 at 12:17:04 AM UTC+3, Jim S wrote:
>>>
>>> I have a simple SQLFORM.factory form.
>>>
>>> Sometimes when I click on the submit button the 
>>> form.process(keepvalues=True).accepted returns False - clicking on enter 
>>> immediately following results in it returning True.  I'm not getting any 
>>> error or flash messages.
>>>
>>> I don't know where to begin looking for my problem.
>>>
>>> Here is the relevant code:
>>>
>>> fields = []
>>> fields.append(Field('brix_level', 'decimal(5,2)', required=True, 
>>> requires=IS_FLOAT_IN_RANGE(70, 99),
>>>  default=wo.brix_level))
>>>
>>> form = SQLFORM.factory(*fields)
>>>
>>> form.element(_name='brix_level').update(_class='form-control')
>>>
>>> if form.process(keepvalues=True).accepted:
>>>
>>> Sometimes it will return False, and then re-submitting with no changes 
>>> on screen, it will return True.
>>>
>>> This is happening in my form that is in a LOADed Component in a 
>>> bootstrap modal window.
>>>
>>> Sequence of events:
>>>
>>> 1. Click button to display the modal window and the form.
>>> 2. Change brix level from 86 to 85
>>> 3. Click on submit
>>>
>>> form.process().accepted returns False
>>>
>>> brix level on the form field returns to 86
>>>
>>> 4. Change brix level from 86 to 85
>>> 5. Click on Submit
>>>
>>> Everything works fine...
>>>
>>> Any ideas what I'm missing?
>>>
>>> -Jim
>>>
>>

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