On Sunday, October 16, 2011 3:23:01 AM UTC-4, miroslavgojic wrote:
>
> I tray to put mentioned examples into controller after my form definition
>
> form['_action'] = URL(index')
> form.update(_action=URL('index'))
> form.attributes.update(_action=URL('index'))
>
> but it is not happened anything,
>
What exactly happened? I assume this does change the form action as 
expected, but then nothing happens when you submit the form? When you change 
the form action, the form will get submitted to that action. If you submit 
the form to 'index', then your 'index' function will have to process the 
submitted form -- if there's no code in your 'index' function to do so, then 
nothing will happen. In web2py, forms are typically self-submitting (i.e., 
submitted to the action that generated them). Is there a reason you want to 
submit the form to a different action?
 

> and if I change my value I just get error
>
> form.update(_action=my_value) - this make error
>
What is my_value? Is it a URL?

 

> In view after beginning of form.custom.start I tray next similar code
> {{=form['_action'] = URL(index')}}
>
I assume you mean form.custom.begin? Anyway, it will not work to change the 
form action after that because form.custom.begin actually inserts the <form> 
tag with the action specified -- so changing the action after will not 
affect the way the form is serialized.

Anthony

Reply via email to