So basically, you have a form created with SQLFORM, then there is an add
button, when you click it, you can add new records, then ajax returns and
you append the new options to the form?

So the form fails only if you add new?

Is this the correct understanding of the problem?

If so, I believe it might have something to do with _formkey and session
storing what the form is expecting?

-Thadeus




On Tue, Oct 13, 2009 at 4:25 PM, Renato-ES-Brazil
<[email protected]>wrote:

>
> Thadeus,
>
> But when I create the form manually it works.
> The only difference is that I put the same value into the attributes
> ID and NAME.
>
> Thanks.
>
> On 13 out, 13:29, Thadeus Burgess <[email protected]> wrote:
> > Perhaps its a problem with _formkey?
> >
> > -Thadeus
> >
> > On Tue, Oct 13, 2009 at 11:17 AM, Renato-ES-Brazil <
> [email protected]
> >
> > > wrote:
> >
> > > Massimo,
> >
> > > #1. Any idea? :-)
> >
> > > #2. Is there any way of SQLFORM put the same values into the
> > > attributes ID and NAME?
> >
> > > On 12 out, 23:17, Renato-ES-Brazil <[email protected]> wrote:
> > > > Massimo,
> >
> > > > Sorry, I'll try to explain better...
> >
> > > > I know that the values are in request.vars, therefore I made the
> > > > observation: "form.accepts" failed even with all the values in
> > > > request.vars. :-/
> >
> > > > The problem mentioned just occurs when I submit a form, created by
> > > > SQLFORM, via ajax.
> >
> > > > I think it happens because of "ID" and "NAME" of the html objects are
> > > > created with different values when I use SQLFORM.
> >
> > > > When I create a form manually with the same values for "ID" and
> > > > "NAME", as in the example on page 277 of the manual, it works.
> >
> > > > On Oct 12, 10:51 pm, mdipierro <[email protected]> wrote:
> >
> > > > > I am not sure I understand. the values are always in request.vars.
> > > > > Those values that pass validation they are copied in form.vars.
> >
> > > > > On Oct 12, 7:46 pm, Renato-ES-Brazil <[email protected]>
> wrote:
> >
> > > > > > I'm working with this idea again.
> >
> > > > > > Clicking on the link "add" opens a div popup with a form to
> create
> > > the
> > > > > > record. This form is submitted via ajax, but I'm having a
> problem:
> > > the
> > > > > > validation with form.accepts is failing, but the values are in
> > > > > > request.vars.
> >
> > > > > > Seems to be due to SQLFORM put different values for the
> attributes ID
> > > > > > ("tablename_fieldname") and NAME ("fieldname") in the objects.
> >
> > > > > > I've created a form manually and put the same value for
> attributes
> > > > > > "ID" and "NAME", and it worked.
> >
> > > > > > Any tips?
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to