Why would you need to create an action for the form? Are you not using self
submit?
On Wednesday, November 7, 2012 12:22:03 PM UTC-7, Simon Carr wrote:
>
> I have this piece of code that calls a function in my controller when
> clicked.
>
> {{=A('Add to My Charts',callback=URL('subscribe_form',vars={'chartname':
> chart.chartName}),target=str(chart.chartName).replace('.','_'))}}
>
>
> The subscribe_form function looks like this
>
> def subscribe_form():
>
> form =
> SQLFORM(db.user_chart,fields=['title','description'],hidden=dict(chartname=request.vars['chartname']))
> if form.process().accepted:
> response.flash = 'form accepted'
> elif form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill out the form'
> return form
>
> The Form is created by AJAX, but it's action is blank.
>
> Do I have to specify the action myself if I am build a Form via AJAX?
>
> Simon
>
--