Hello I have two functions one for querying the data base and one for
submitting data. I also have one view for the form and one load file for
the database query I then LOAD the load file into index view
{{extend "template.html"}}
<div id="content">
{{=LOAD('default', 'ajax_example.load', ajax=True)}}
</div>
My Form controller
@auth.requires_login()
def myform():
form = SQLFORM(db.music2)
if form.accepts(request.vars):
response.flash='Thanks for filling the form'
#"%s",[],"song_list" is a reference to a div that gets called and
updated
return XML('ajax("%s",[],"song_list");' % URL('default',
'ajax_example.load'))
elif form.errors:
response.flash='Fill the form correctly'
else:
response.flash='Please, fill the form'
return dict(form=form)
Ok I guess my problem is how can I update song_list with out a page refresh
keep in mind the form is on a separate page then the query
How can I get return XML('ajax("%s",[],"song_list");' % URL('default',
'ajax_example.load')) to display the form again with a response.flash
message and then update the div on the separate page in real time?
Any ideas
*cheers :-)