The problem is that Im at a loss. Right now, the process function calls
next and sends to the default page.
ajax_form = SQLFORM(db[field_array[3]], this_page_ajax,
deletable=True).process(next = URL('default', field_array[4],
vars=dict(cli=field_array[0])))
And Ive got it set up to deal with a situation where it returns something
to the browser if accepted:
ajax_form = SQLFORM(db[field_array[3]], this_page_ajax, deletable=True)
if ajax_form.process().accepted:
return "fish"
'Fish' obviously displays, but I cant get it to send javascript that can be
used to update the parent
My next attempt is ....(onsuccess=success_func)
The problem with that is that I cannot think of a way to structure a
function -- ie. success_func -- that would somehow write to the parent.....
So I'm somewhat at a loss...I know Im supposed to supply more code, but Im
just at loggerheads with this one and the only thing I can think of is to
override the submit button with a HREF/Callback and direct the output to a
div. I have no problem doing that, or putting together a plugin for that
matter, but I'm guessing there is a more elegant way to do this....
On Monday, April 25, 2016 at 9:41:55 PM UTC-4, Massimo Di Pierro wrote:
>
> Can you show up some more code.
>
> On Monday, 25 April 2016 08:51:14 UTC-5, Mark Billion wrote:
>>
>> I have a form that is accessed through ajax and displayed in a
>> modal....Right now, on success, the modal clears and the parent page is
>> reloaded, which then shows the data that was entered in the table.
>>
>> i.e.,
>>
>> ajax_form = SQLFORM(...).process(next = URL('default', page_name))
>>
>> {{for x in y:}}
>> <table>
>> <tr><td>x.id</td><td>x.attr1</td><td>x.attr2</td></tr>
>> </table>
>> {{pass}}
>>
>>
>> I want to prevent the parent from reloading and update the parent page
>> via ajax on form success to include the data that is entered. Can anyone
>> point me to a script I can modify?
>>
>
--
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.