Regarding your first issue:

When doing multiple selects, a form post just lists identical values
like this (oversimplification, but you get the point):

french=mustard&french=fries&french=wine

The problem comes when webpy tires make a dictionary out of these, it
gets identical keys, so only the last value 'sticks'.  The way around
this is to specify that you're expecting a list of variables like so:

web.input(french=[])

So, you could call:
f = myform()
if not f.validates(web.input(french=[])):
    print f.render() #you know the rest
else:
    web.debug(f.d) #debug the form values, you'll see the list come up

and then create a new Validator like this:

form.Validator('select at least 1', lambda x:len(x)>0)

It's not terribly elegant, but there are ways to make it work.

About your second point, you can always just call web.input() to get
user input -- it'll create a dictionary of all variables posted.  That
way you can check out the input without validating (but, again, it's a
dictionary so multiple items won't work).

Hope this helps,
Justin


On Aug 6, 5:00 pm, "Matteo Zandi" <[EMAIL PROTECTED]> wrote:
> On 8/6/07, Matteo Zandi <[EMAIL PROTECTED]> wrote:
>
> > The problem is that if I select more than one 'french', it only displays
> > one of them, ie
>
> > Is it a known problem? I coulnd't find any bugs about it in launchpad and I 
> > couldn't find an answer myself.
>
> Moreover, if you don't validate user's input, you don't get any result,
> since input.value is assigned only when you validate it. I think this is
> another bug, I might want not to validate user input and still know what he
> entered.
>
> This should be another bug, since I'm rather novice with web.py I wait for
> advice from the list before filing bugs :)
>
> Matteo


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to