On Wednesday, November 9, 2011 5:11:40 PM UTC-5, Richard wrote: > > > Now I would like to know how I can intercept the html form before it get > in the face of the user... I mean I use to do this hack to show user help > bubble to the user : > > > form = crud.create(db[request.args(0)]) > for i in range(0,len(form[0])): > if len(form[0][i][2][0]) > 0: > form[0][i][0].append(SPAN((helpicon(), > SPAN(form[0][i][2][0])),_class='tooltip')) > del(form[0][i][2]) > > So I would do the same with create, update form generated by SQLFORM.grid >
In the create/update case, grid returns a div with the form as the second component, and it looks like the form is also accessible via form.create_form and form.edit_form, so I assume you should be able to use some variation of the above to manipulate the form before returning it to the view. Anthony