Ach! Thanks. Now it runs. leone On 14 Gen, 15:13, mdipierro <mdipie...@cs.depaul.edu> wrote: > You have Field('name',type=None) and this cannot be. > > On Jan 14, 7:35 am, leone <handja...@gmail.com> wrote: > > > > > I am trying to build a complex widget that mixes helpers (an INPUT > > helper) and plain html code that include others input tags used by > > javascript. > > It output all by (DIV object).components.extend([...,...]). > > It is all ok when SQLFORM.factory displays it, but fail when I accept > > the form: > > > ........ > > if form.accepts(request.vars, session): > > File "/web2py/web2py/gluon/sqlhtml.py", line 897, in accepts > > self.vars.id = self.table.insert(**fields) > > File "/web2py/web2py/gluon/sql.py", line 1847, in insert > > query = self._insert(**fields) > > File "/web2py/web2py/gluon/sql.py", line 1832, in _insert > > vs.append(sql_represent(value, ft, fd, self._db._db_codec)) > > File "/web2py/web2py/gluon/sql.py", line 497, in sql_represent > > if fieldtype[0] == 'i': > > TypeError: 'NoneType' object is unsubscriptable > > > Any idea about my error? > > > On 14 Gen, 09:19, leone <handja...@gmail.com> wrote: > > > > I am making a widget with more fields that must return a single value > > > when form is submitted. > > > I have two way (I suppose..): to use javascript at the submit event of > > > specific form (I need form id) or/and to put > > > validation code in widget function. > > > The better should be have code to study to discover the web2py way to > > > solution. > > > Thanks > > > leone > > > > On 13 Gen, 19:26, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > > How a widget can know the name and id of the form in which it resides? > > > > > The built-in widgets do not know. > > > > You can make your own widget and pass the information to it. > > > > What do you have in mind? > > > > > On Jan 13, 12:13 pm, leone <handja...@gmail.com> wrote: > > > > > > Is it possible to use javascript function on submit? > > > > > yes. Look into web2py_ajax.html. It does that. > > > > > > Thanks > > > > > leone
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@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.