Re: [web2py] IS_IN_DB zero= solution

2013-08-17 Thread Richard Vézina
jQuery!! When the select is focused popup something like tooltip in bootstrap... Richard On Fri, Aug 16, 2013 at 2:59 AM, Niphlod wrote: > > >> In my table definitions I do use comments to give directives, however, >> this is a custom form on a landing page, and I think labels and comments in

Re: [web2py] IS_IN_DB zero= solution

2013-08-16 Thread Niphlod
> > In my table definitions I do use comments to give directives, however, > this is a custom form on a landing page, and I think labels and comments in > this case make the form look ugly, so I use placeholders to replace the > labels and comments. For a select this doesn't work: > > form.ele

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Annet
> On the other end, a multiple select is a totally different "beast", > because choices are shown to the user having a multiple select with a > field that stands for "please do something" in it is a poor design > decision. > Probably. In my table definitions I do use comments to give di

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Niphlod
I agree. The purpose of the "zero" option is to prefill a select with an helper and return an error if that option is the one selected (meaning that the user didn't choose anything). This has been requested because if there is no sane default to provide, having a dropdown with nothing in it tell

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Richard Vézina
You use multiple... So I guess as Niphold says you can't use zero... Maybe consider create some kind of popover or use comment that is there for that purpose so beside you field the user will be tell to select 4 functions... Richard On Thu, Aug 15, 2013 at 3:26 PM, Richard Vézina wrote: > May

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Richard Vézina
Maybe you could use IS_IN_SET... You just have to pass you query to it on construct a dict from the query... Refer you to this post of Anthony : https://groups.google.com/d/msg/web2py/QBTYaytNypU/DW2HpnT-xK0J http://web2py.com/books/default/chapter/29/07/forms-and-validators#Validators Scroll a b

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Annet
Thank you both for your replies. apart from that, IS_IN_DB totally works with zero (unless multiple=True, in > which a zero argument kinda defeats the purpose). Are you sure that you're > not adding other validators to that field ? > This is the IS_IN_DB validator: db.register.navID.requires=

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Niphlod
apart from that, IS_IN_DB totally works with zero (unless multiple=True, in which a zero argument kinda defeats the purpose). Are you sure that you're not adding other validators to that field ? On Thursday, August 15, 2013 7:59:55 PM UTC+2, Richard wrote: > > insert(0, "Select 4 functions") doe

Re: [web2py] IS_IN_DB zero= solution

2013-08-15 Thread Richard Vézina
insert(0, "Select 4 functions") doesn't work? Richard On Thu, Aug 15, 2013 at 1:56 PM, Annet wrote: > Since IS_IN_DB ignores zero='' I tried this: > > form.element('select[name=navID]').append("Select 4 functions") > > However, the options are sorted by id and "Select 4 functions" ends > up a

[web2py] IS_IN_DB zero= solution

2013-08-15 Thread Annet
Since IS_IN_DB ignores zero='' I tried this: form.element('select[name=navID]').append("Select 4 functions") However, the options are sorted by id and "Select 4 functions" ends up as the last option. Is there a way to move it to the top of the list of options? Kind regards, Annet -- --- Y