Hello Massimo, Thanks for the reply... Oh Yes i did define the form, i just think the reader will assume that i was define since i wanted to describe more what my problem was... I just send you the application by email... I'm using the latest version 1.58
Cheers, Yannick P. On Mar 15, 3:08 pm, mdipierro <[email protected]> wrote: > Your code does not show where form is defined, nor the model. Please > email the entire app to me and I will take a look. customization of > forms does not affect validation, although in your case, it will not > display error messages. If the records are not validated at all, then > something else is going on. > > Massimo > > On Mar 15, 1:36 pm, Yannick <[email protected]> wrote: > > > Hello mate, > > > Using Auth when I customize the form (which means I don't use {{= > > form}}) on the views the validation "IS_NOT_IN_DB" doesn't seems to > > work and any other validation as well... > > > For example on the registration view page: > > instead of using: > > {{=form}} > > I use a custom form something like: > > > <form> > > first Name: <input class="string" > > id="auth_user_first_name" name="first_name" type="text" > > value="{{=form.latest.first_name}}" /> > > email: <input class="string" id="auth_user_email" > > name="email" type="text" > > value="{{=form.latest.email}}" /> > > ... > > ... > > {{=form.hidden_fields()}} > > > </form> > > > Using the custom form on view I can register several users with the > > same email which is not good since the table is define to not do so... > > using {{=form}} in the view there is an error message (Everything > > works as expected) > > > So I tried to create a custom validation in my action that verify if > > the email is already in the DB and if yes raise an error... > > Here is my code in the controller: > > > def register(): > > if form.accepts(request.vars,formname='register'): > > user = self.db(db.auth_user.email==request.vars.email.strip > > ()).select() > > > if user: > > session.flash = 'Already In the DB Sorry' > > next = URL(r=request, f='register') > > redirect(next) > > ...... > > ...... > > Using this custom validation, it doesn't work I still can register > > several users with the same email... > > > Do you please have any idea how to resolve this issue ? am I doing > > something wrong ? > > > Thanks for your attention, > > Yannick P. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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 -~----------~----~----~----~------~----~------~--~---

