{{request_details_form.custom.end}}
should be
{{=request_details_form.custom.end}}
On Thursday, 7 February 2013 05:58:45 UTC-6, Andrew Buchan wrote:
>
> Hello,
>
> I'm using a form.custom, but clicking on submit doesn't trigger validation
> or submission. The page just refreshes.
> The code below always results in 'dont know' at the response.flash...
>
> Controller:
>
> ...
> fields = [......]
> request_details_form = SQLFORM(db.capacity_request,
> fields=fields)
>
> # testing to see if any of these happen on submit... always come up as
> 'dont know'...
> if request_details_form.process().accepted:
> response.flash = 'processed'
> elif request_details_form.errors:
> response.flash = 'errors'
> elif request_details_form.accepts(request.vars, session, dbio=False):
> response.flash = 'accepted'
> else:
> response.flash = 'dont know'
> return dict(request_details_form=request_details_form)
>
> ----------------
>
> View:
>
> .....
> {{=request_details_form.custom.begin}}
> <table id="request_details_table">
> <!-- Form won't necessarily include all fields.... -->
> {{for field_name in ['team', 'raised_on', 'raised_by', 'contract',
> 'client',
> 'owner', 'required_by', 'requested_hours',
> 'output_formats', 'rechargeable_to_client',
> 'comments',
> 'lbg_property_code',
> 'has_project_been_set_up_on_Doc_Ex',
> 'has_project_mailbox_been_set_up',
> 'actual_return_date']:
> }}
> {{if request_details_form.custom.widget.has_key(field_name):}}
> <tr>
> <td>{{=request_details_form.custom.label[field_name]}}</td>
>
> <td>{{=request_details_form.custom.widget[field_name]}}</td>
> </tr>
> {{pass}}
> {{pass}}
> <!-- form doesn't have submit button in view mode... -->
> {{if request_details_form.custom.submit:}}
> <tr>
> <td><label>go: </label></td>
> <td>{{=request_details_form.custom.submit}}</td>
> </tr>
> {{pass}}
> </table>
> {{request_details_form.custom.end}}
> ....
>
> The form displays fine, it just won't submit.
> Anyone have any ideas?
> Also why should I use form.process.accepts() instead of form.accepts (I
> saw that advice somewhere relating to custom forms)
> Using version 2.3.2.
>
> Thanks,
>
> Andy.
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.