Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-09-22 Thread Brian M
Try this it'll give you a form, intercept the form submission and instead do an ajax call to the validate page which checks the email and password and if that's correct will return True and the page will get forwarded via JS to the next page with your email & password in the URL as args. Why do

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-09-21 Thread jjcurats
good day great folks..i've been encountering same problem here..i have 2 variables in my function to pass in my controller...i just cant do it right trying lot of options already..here's my code: $(function() { $('#client-login').bind('submit',function(event){ var email = $(

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-22 Thread Ashraf Mansour
Thank you, Anthony. document.getElementById('url_with_params').href = "{{=URL('action')}}" + "/" + param1 ; is working fine. >>

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-22 Thread Ashraf Mansour
Thank you, Bruce. document.getElementById('url_with_params').href = "{{=URL('action')}}" + "/" + param1 ; is working fine. >

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Bruce Wade
If param1 and param2 are from javascript: 1) You can not write the code in headers as you have current written you will have to use something like the following: // javascript function: function generateURL(param1, param2) { url = '/action/' + param1 + "/" + param2; $("url_with_params"

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Anthony
> > both > > > > and > > > > > are not working ( they are not showing the values of param1 and param2 ) > You are simply putting the literal strings "param1" and "param2" directly into your HTML there, so of course the values of those variables won't be shown. What are param1 and pa

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Anthony
> > let me brief what i am doing. I am building an application accessing > google maps api v3. I need the function that decide if a certain point is > within certain bounds. my understanding is that i need to do that in the > view ( by passing the point and the coordinates of the bounds ). the

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Ashraf Mansour
both and are not working ( they are not showing the values of param1 and param2 ) >

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Anthony
I wasn't suggesting he should use the URL() function, just pointing out that it *can't* be used to build a URL on the client side, and showing a simple example of how to build a URL on the client side via Javascript (use of the URL() function was incidental and not central to the point of the e

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Bruce Wade
You do realise that you are missing the closing >? Also what you are trying to do in this code will never work. becomes /param1/param2 Try this: On Sun, May 20, 2012 at 7:09 PM, Ashraf Mansour wrote: > thank you for your interest. > > let me brief what i am doing. I am building

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Ashraf Mansour
thank you for your interest. let me brief what i am doing. I am building an application accessing google maps api v3. I need the function that decide if a certain point is within certain bounds. my understanding is that i need to do that in the view ( by passing the point and the coordinates of

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Bruce Wade
Well honestly if it was a dynamic link I wouldn't even use URL as good style of JS programming is putting the code in a .js if this is the case then the web2py parser cannot even access the URL to parse it. (At least I have never been successful with that process.) If they are getting the params a

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Anthony
He said param1 and param2 are determined on the client side -- which means they cannot be set on the server side by web2py. Of course, I don't know what he's actually doing on the client side, so this exact code may or may not be relevant. Do you have an alternative suggestion? Anthony On Sund

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Bruce Wade
Why would you do the code like that?? [?] Updated: jQuery(function() { var param1 = 'hello' var param2 = 'world' jQuery('a#mylink').attr('href', '{{=URL("action", args=["' + param1 + '","' + param2 + '"])}}'); }); {{=A('...', _href='', _id='mylink')}} On Sun, May 20, 2012 at 4:36 PM, Ant

[web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Anthony
On Sunday, May 20, 2012 3:43:38 PM UTC-4, Ashraf Mansour wrote: > > thanks for the immediate reply. > > param1 and param2 are determined on the client side. > > how can it be generated by javascript? > > It depends. Here's one example: jQuery(function() { var param1 = 'hello' var param2 = '

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Ashraf Mansour
thanks for the immediate reply. param1 and param2 are determined on the client side. how can it be generated by javascript? > >>>

[web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Ashraf Mansour
thanks for the immediate reply. param1 and param2 are determined on the client side. how can it be generated by javascript? On Sunday, May 20, 2012 10:05:10 PM UTC+3, Anthony wrote: > > On Sunday, May 20, 2012 1:18:44 PM UTC-4, Ashraf Mansour wrote: >> >> I tried this >> >> >> >> and it did no

[web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Anthony
On Sunday, May 20, 2012 1:18:44 PM UTC-4, Ashraf Mansour wrote: > > I tried this > > > > and it did not work.:) > > what is the right way of doing it? > A() doesn't produce a URL -- it produces an anchor tag (i.e., ...), to which you are then appending "/param1/param2", which obviously doesn't w

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Bruce Wade
{{=URL('controller','action', args=[arg1, arg2])}} On May 20, 2012 10:18 AM, "Ashraf Mansour" wrote: > I tried this > > > > and it did not work.:) > > what is the right way of doing it? > > On Saturday, December 3, 2011 7:37:58 PM UTC+3, Anthony wrote: >> >>

[web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Ashraf Mansour
I tried this and it did not work.:) what is the right way of doing it? On Saturday, December 3, 2011 7:37:58 PM UTC+3, Anthony wrote: > >

[web2py] Re: Pass multiple arguments to URL through javascript

2012-05-20 Thread Ashraf Mansour
I think this is an important topic, And needs to be highlighted in the book and by example. On Saturday, December 3, 2011 7:10:59 PM UTC+3, Vineet wrote: > > I referred to the below-mentioned thread (but could not reply to it). > > > https://groups.google.com/group/web2py/browse_thread/thread/61d

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-06 Thread Vineet
@Brian, Thanks. I will experiment with this plugin. Looks like very interesting stuff. --- Vineet On Dec 5, 6:16 am, Brian M wrote: > Vineet, > > My copy of jQuery.query.js is attached - I'm assuming since it's released > under the WTFPL the author won't mind :D > > You may also want to look at

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-04 Thread Brian M
Vineet, My copy of jQuery.query.js is attached - I'm assuming since it's released under the WTFPL the author won't mind :D You may also want to look at these: http://stackoverflow.com/questions/2053157/how-to-use-jquery-to-manipulate-the-querystring http://stackoverflow.com/questions/4344405/jqu

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-04 Thread Massimo Di Pierro
Ignore my comment... I missed the context. On Dec 4, 12:33 pm, Massimo Di Pierro wrote: > what's wrong with? > > {{=URL(...,vars=dict(p1=param1,p2=param2))}} > > On Dec 4, 2:14 am, Jonathan Lundell wrote: > > > > > > > > > On Dec 3, 2011, at 11:32 PM, Vineet wrote: > > > > @Anthony, thanks. Your

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-04 Thread Massimo Di Pierro
what's wrong with? {{=URL(...,vars=dict(p1=param1,p2=param2))}} On Dec 4, 2:14 am, Jonathan Lundell wrote: > On Dec 3, 2011, at 11:32 PM, Vineet wrote: > > > @Anthony, thanks. Your method worked. > > Secondly, if I want to pass arguments by name, would it be okay to do > > something like this--

Re: [web2py] Re: Pass multiple arguments to URL through javascript

2011-12-04 Thread Jonathan Lundell
On Dec 3, 2011, at 11:32 PM, Vineet wrote: > @Anthony, thanks. Your method worked. > Secondly, if I want to pass arguments by name, would it be okay to do > something like this>> > > {{=URL(...)}} + '/' + 'p1=' + param1 + '/' + 'p2=' + param2 Almost. You want: {{=URL(...)}} + '?p1=' + para

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread Vineet
@Anthony, thanks. Your method worked. Secondly, if I want to pass arguments by name, would it be okay to do something like this>> {{=URL(...)}} + '/' + 'p1=' + param1 + '/' + 'p2=' + param2 @Brian, I would be interested & grateful to you if you can send me a copy of jQuery.query (as mention

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread Vineet
Brian, Yes. I would be interested & grateful to you if you can send me a copy (as mentioned by you). Thanks, Vineet On Dec 4, 3:53 am, Brian M wrote: > I've used a jQuery plugin called jQuery.query that can manipulate URLs.  If > memory serves correct you do something along the lines of > $.quer

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread Vineet
Thanks Anthony. That worked. Secondly, if I want to pass arguments by name, would it be okay to do something like this>> {{=URL(...)}} + '/' + 'p1=' + param1 + '/' + 'p2=' + param2 ---Vineet On Dec 3, 9:37 pm, Anthony wrote: > >

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread Brian M
I've used a jQuery plugin called jQuery.query that can manipulate URLs. If memory serves correct you do something along the lines of $.query.set('var', value) to set querystring values. And $.query.get('var') to retrieve. Sadly the jQuery team seems to have taken down the jQuery plugins site a

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread Anthony
On Saturday, December 3, 2011 3:48:06 PM UTC-5, lyn2py wrote: > > You can try: {{URL('static','action',args=[param1,param2])}} No, param1 and param2 are Javascript variables set on the client side, but the URL function is called on the server side before the page is delivered. So, param1 and pa

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread lyn2py
You can try: {{URL('static','action',args=[param1,param2])}} On Dec 4, 12:10 am, Vineet wrote: > I referred to the below-mentioned thread (but could not reply to it). > > https://groups.google.com/group/web2py/browse_thread/thread/61d57e887... > > My question is --- > If I have two javascript v

[web2py] Re: Pass multiple arguments to URL through javascript

2011-12-03 Thread Anthony
> >