1) Do not use form.hidden_field() since that is called automatically
2) the formkey should be added when you call
form.accepts(...,session). If you do not pass session, no formkey.

On 30 Giu, 04:59, selecta <[email protected]> wrote:
> just found out thathttp://www.web2py.com/AlterEgo/default/show/205
> is WRONG
>
> {{=form.hidden_fields()}}
> {{=form.custom.end}}
>
> do not play well together, just using
>
> {{=form.custom.end}}
>
> will do the trick, would be nice to 
> changehttp://www.web2py.com/AlterEgo/default/show/205
>
> On Jun 30, 11:47 am, selecta <[email protected]> wrote:
>
> > i created a form with
> > form = form_factory(
> >             Field('role', requires = IS_NOT_EMPTY(), label="Name"),
> >             Field('description', 'text')
> >             )
>
> > and rendered it with
> > {{=form.custom.begin}}
> > <div id="create_group">
> >     <h3>Description</h3>
> >     <table id='main_frm'>
> >         <tr>
> >             <th>Name</th>
> >             <td><div>{{=form.custom.widget.role}}</div></td>
> >         </tr>
> >         <tr>
> >             <th>Description</th>
> >             <td><div>{{=form.custom.widget.description}}</div></td>
> >         </tr>
> >     </table>
> >     <h3>Select Members</h3>
> >     {{=select_members_table}}
> >     <input type="submit" value="Create Group" name='submit'/>
> >     {{=form.hidden_fields()}}
> > {{=form.custom.end}}
> > </div>
>
> > now i would expect form.hidden_fields() to render the formkey, but it
> > does not, it just renders
> > <div class="hidden"><input name="_formname" type="hidden"
> > value="no_table_create" /></div>
> > <div class="hidden"><input name="_formname" type="hidden"
> > value="no_table_create" /></div>
> > (yes twice, no clue why)
>
> > did I miss something?

Reply via email to