Here`s the jquery code: function treelink() { query=encodeURIComponent('code')+"="+encodeURIComponent(jQuery (this).attr('name')); jQuery.ajax({type: "POST", url: '{{=URL(r=request,f='buildPage')}}', data: query, success: function(msg) { document.getElementById('magic').innerHTML=msg; web2py_ajax_init(); }}); return false; }
This function is called when a link is clicked on the page the form is being brought into. I`m pretty sure the reason it wasn`t working had to with the fact that the form action was blank, which meant it was posting to the function of the page it appeared on. Since this is not the page that created the form, there`s nothing in it to handle the form data. I`m currently seeking an alternative route in a new thread. On Aug 26, 8:36 am, DenesL <denes1...@yahoo.ca> wrote: > Hard to tell without the code that does the ajaxing. > > On Aug 23, 7:11 pm, Alastair Medford <alastairmedf...@gmail.com> > wrote: > > > > > So it's looking like using an SQLFORM in the regular fashion just > > isn't going to cut for what I would like to do. If I override the > > normal submission method and use jquery + ajax to submit the form, I > > have full control of what the page does after submission. The problem > > then is that I would loose validation, auto insertion, and any point > > of using SQLFORM in the first place. Any suggestions? This still > > doesn't explain my main problem of why the form only refreshes the > > page, but it's given me some ideas. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---