On 21 abr, 00:51, DenesL <denes1...@yahoo.ca> wrote:
> Jose, if I understand correctly you don't want to show the drop down
> with the options from the IS_IN_SET.
> You can do this by changing the input widget of the field:
>
> db.my_table.my_field.widget=lambda self,value:
>        INPUT(_type='text', _id='%s_%s' %(self._tablename,self.name),
>        _class=self.type,_name=self.name,value='')
>
> so now it will be displayed as a simple input in the form.
> The requires stays the same to validate the user's reply.
>
> Denes.
>

Probably it is a problem of since explaining it, my english is bad.

Let's see this example (does not exist  databases, tables, nor of
SQLFORM):

def show_form():
    form = FORM('Question:',
            INPUT(_name='name',requires=[IS_IN_SET
(['Answers1','Answers2','Answers2'])]),
            INPUT(_type='submit'))

    if form.accepts(request.vars,session):
        redirect(URL(r=request,f='index'))

    return dict(form=form)

If I try it, it works well. Only accepts the values: Answers1,
Answers2 or Answers3.
With another value it shows: " value not allowed ". It this well.

Massimo said that always the validation is realized in the server. But
Answers1, Answers2, etc. they travelled towards the browser of the
client (they are hidden).

Doing this:

import urllib2

f = urllib2.urlopen("http://127.0.0.1:8000/myapplication/default/
show_form")
a = f.read()
...
f.close()

And knowing that the answers are somewhere, I can parsear (analyze)
the code and obtain the answers by means of a robot to fill the form.
(The idea is to implement something similar to captcha but with text.)

I want to know is like to prevent the possible answers travel towards
the browser of the client.

Jose

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to