On Oct 27, 7:45 pm, pierreth <
pierre.thibau...@gmail.com> wrote:
> Hello,
>
> I am doing my first application with web2py and I don't know how to do
> some things with forms.
>
> Like I would like to show a drop menu to show the possible values for
> a text field. How can I specify this menu with define_table?
>
Field('name',requires=IS_IN_SET(('value1,'value2',value3')))
> Another thing that I would like to do is format postal code and phone
> numbers with javascript when the user leaves a field.
<script>
jQuery(document).ready(function(){
var t=jQuery('#table_field');
t.keyup(function(){t.val(format(t.val());});
});
</script>
where "table" and "field" are your table and field names. format(...)
is the function that formats the input into output and you need to
define it in JS.