Sorry Fauché, I did got get your previous email.

here are two issues:
1)
   SELECT(liste,_id="choix",_name="choix")

should be

   SELECT(*liste,_id="choix",_name="choix")

This does not appear to be causing the second problem but it is the
proper syntax.

2) You problem is caused by the fact that

   _onclick="ajax('onclick_go',['choix'],'target')"

build a relative path, not an absolute paths. In the second case you
have args[0] attached to path so the new path gets to be

    http://..../app/default/form_select/click_go

instead of

    http://..../app/default/click_go

You should replace the above line with

   _onclick="ajax('%s',['choix'],'target')" % URL(r=request,f='
click_go')

This will fix your problem.

Massimo


On Jun 14, 4:58 pm, Fauché JM <jm.fau...@free.fr> wrote:
> Hello ,
> Here is a copy from a message I send to Massimo but without response
> (maybe I send it to a wrong place..),I spend a long time to anderstand
> maybe my code is wrong or the solution stupid but I don't find the
> solution .If you can help me ...
>
> I have a problem:
>
> 1- in controlers I write this code:
>
> def form_select():
>     liste=["joe","jack","bill"]
>     form=FORM(TABLE(TR(SELECT(liste,_id="choix",_name="choix"),
>                        INPUT(_type='button',
>                              _value='validation',
>                              _onclick="ajax('onclick_go',
> ['choix'],'target')"))))
>     return dict(form=form,target=DIV(_id='target'))
>
> def onclick_go():
>     return TABLE(request.vars.choix).xml()
>
> 2-in views default/index:
>
> {{extend 'layout.html'}}
> <a href="{{=URL('Test_select','testing','form_select')}}">click here
> for testing the form_select<br />
>
> On this way all is OK ...
>
> BUT if i want to pass args from index to form_select:
> like this:
> 1- in controlers I write this code:
>
> def form_select():
>     other=request.args[0]
>     liste=["joe","jack","bill",other]
>     form=FORM(TABLE(TR(SELECT(liste,_id="choix",_name="choix"),
>                        INPUT(_type='button',
>                              _value='validation',
>                              _onclick="ajax('onclick_go',
> ['choix'],'target')"))))
>     return dict(form=form,target=DIV(_id='target'))
>
> def onclick_go():
>     return TABLE(request.vars.choix).xml()
>
> 2-in views default/index:
>
> {{extend 'layout.html'}}
> <a href="{{=URL('Test_select','testing','form_select',args=
> ['Max'])}}">click here for testing the form_select<br />
>
> Then I have a big problem :the result of ajax in target give another
> page issue from form select !!!
> Have you an explanation? or a solution?
>
> Thank you + + +
> Fauché Jean-Marc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to