[web2py] Re: GET and POST issue

2013-05-19 Thread Annet
> So, the alert() immediately before web2py_component() gets called, yet no > ajax call is made? That's right. > Do you get a Javascript error in the console? The JS console displays 5 requests, no errors. > Are you sure web2py.js is loaded in the page? Yes, web2py.js is loaded. I t

[web2py] Re: GET and POST issue

2013-05-19 Thread Anthony
So, the alert() immediately before web2py_component() gets called, yet no ajax call is made? Do you get a Javascript error in the console? Are you sure web2py.js is loaded in the page? Anthony On Sunday, May 19, 2013 2:26:35 AM UTC-4, Annet wrote: > > > Using the developer tools, when you click

[web2py] Re: GET and POST issue

2013-05-18 Thread Annet
> Using the developer tools, when you click the link, do you observe the > Ajax call being made? If so, does it return the expected response? > Using Firefox's developer tools, when I click the link no Ajax all is being made. Best regards, Annet -- --- You received this message because

[web2py] Re: GET and POST issue

2013-05-18 Thread Anthony
> > If you add the following alerts, do either of them pop up? >> >> jQuery(function() { >> alert('registering click handler'); // should pop up on page load >> jQuery('#vCardModalLink').click(function() { >> alert('loading component'); // should pop up when the link is >> clicked >>

[web2py] Re: GET and POST issue

2013-05-18 Thread Annet
> > If you add the following alerts, do either of them pop up? > > > jQuery(function() { > alert('registering click handler'); // should pop up on page load > jQuery('#vCardModalLink').click(function() { > alert('loading component'); // should pop up when the link is clicked > web2

[web2py] Re: GET and POST issue

2013-05-18 Thread Anthony
> Not sure why the Javascript isn't working -- perhaps the Bootstrap modal >> code is interfering. Maybe use the browser developer tools to see if the >> click handler is getting registered and called at all. >> > > I used the developer tools, the click handler isn't registered. > If you add t

[web2py] Re: GET and POST issue

2013-05-18 Thread Annet
Hi Anthony, Not sure why the Javascript isn't working -- perhaps the Bootstrap modal > code is interfering. Maybe use the browser developer tools to see if the > click handler is getting registered and called at all. > I used the developer tools, the click handler isn't registered. > vcard=r

[web2py] Re: GET and POST issue

2013-05-18 Thread Anthony
Not sure why the Javascript isn't working -- perhaps the Bootstrap modal code is interfering. Maybe use the browser developer tools to see if the click handler is getting registered and called at all. > > vcard=response.render(view='vcard/vcard.vcf',org=org,n=n,fn=fn,jobtitle=jobtitle

[web2py] Re: GET and POST issue

2013-05-18 Thread Annet
Hi Anthony, Thanks for helping me solve this problem. I gave your solution and corrections a try, but the request for the url just isn't made. I think I give up on solving the problem, there are to many issues I run into trying to solve it. The closest to a functioning solution is: {{=LO

[web2py] Re: GET and POST issue

2013-05-18 Thread Anthony
> %URL('vcard','mailVcard.load',args=node.id)}} data-toggle="modal" > data-target="#vCardModal"> src="{{=URL('static','img/icons/vCard.png')}}" alt="" width="48px" > height="48px" /> > In the above, the HTML doesn't include any quotes around the onclick string. > > $("a[data-toggle=modal]

[web2py] Re: GET and POST issue

2013-05-18 Thread Anthony
Maybe something like this: jQuery(function() { web2py_component('{{=URL('vcard', 'mailVcard.load', args=node.id)}}',target ='vCardModal'); }); Anthony On Saturday, May 18, 2013 3:22:35 AM UTC-4, Annet wrote: > > @Derk, > Thanks for the reference, I built the test app to get a better

[web2py] Re: GET and POST issue

2013-05-18 Thread Annet
I tried: $("a[data-toggle=modal]").click(function (e) { target = $(this).attr('data-target') url = $(this).attr('href') $(target).load(url); }) Which requests the url. I also tried: and: $("a[data-toggle=modal]").click(function (e) { web2py_component("{{=URL('vcard','mai

[web2py] Re: GET and POST issue

2013-05-18 Thread Annet
@Derk, Thanks for the reference, I built the test app to get a better understanding of the way this works, it probably solves the form.custom issue I posted here: https://groups.google.com/forum/?fromgroups#!topic/web2py/3HoDW6ygCDQ @Anthony, Thanks for your reply. > In that case, you might c

[web2py] Re: GET and POST issue

2013-05-17 Thread Anthony
Assuming you don't want the whole page to reload on form submission, you should do an Ajax post. In that case, you might consider loading the form as an Ajax component. Otherwise, you'll have to explicitly set the action of the form to the URL where you want it to post. By default, the action is

[web2py] Re: GET and POST issue

2013-05-17 Thread Derek
Take a look here... http://www.web2py.com/book/default/chapter/11#Ajax-form-submission On Friday, May 17, 2013 11:21:38 AM UTC-7, Annet wrote: > > Hi Derek, > > Thanks for you reply. > > The key is, you want to submit via ajax, and make sure you do a 'return >> false'. If there is an error in

[web2py] Re: GET and POST issue

2013-05-17 Thread Annet
Hi Derek, Thanks for you reply. The key is, you want to submit via ajax, and make sure you do a 'return > false'. If there is an error in your javascript, you may see the post > getting sent to the current url or the action setting of the form. > At the moment I have a SQLFORM.factory() form

[web2py] Re: GET and POST issue

2013-05-17 Thread Derek
Should be fine to have the form in a modal window. I do it on a lot of websites. The key is, you want to submit via ajax, and make sure you do a 'return false'. If there is an error in your javascript, you may see the post getting sent to the current url or the action setting of the form. On Fr

[web2py] Re: GET and POST issue

2013-05-17 Thread Annet
Hi Anthony, My mistake :-( The problem is that the form is posted to http://127.0.0.1:8000/init/vcard/index/6 and not to http://127.0.0.1:8000/init/vcard/mailVcard/6 so the index function instead of the mailVcard function and therefore the form isn't being validated and processed. Maybe it i

[web2py] Re: GET and POST issue

2013-05-17 Thread Anthony
What's the problem with the post? The # isn't sent to the server. On Friday, May 17, 2013 11:16:56 AM UTC-4, Annet wrote: > > > I have this url: > > http://127.0.0.1:8000/init/vcard/index/6 > > In the view I have a link: > > data-target="#vCardModal" >Attach to mail > > When I click the link, Fir