Uhm, while working, i noticed your code does not really have all features i 
tried to implent, i'm sorry.


Am Donnerstag, 17. April 2014 15:35:11 UTC+2 schrieb Lucas Schreiber:

> hey,
> i have a Problem and i don't know how to solve it. I want a form with an 
> Input "text" field ( let's call it "amount') and an <select> <Option> part 
> (let's call it 'area'). And, finally, a "submit" button. All this shall 
> work as follow:
>
> The Options of 'Area' should not only limited by everything in 
> 'area_value', but also by another variable, the db.area.area_name == 1 
> for example. In the Cookies for example the is a variable transfered and 
> now you can only choose from 'area_value' listed in the db and with a 
> matching 'name' 
>
 I guess the model should look like this:
>
 
> db.define_table('area',
>                        Field('area_value', 'string',
>                                notnull=True,
>                                required=True,
>                                requires=IS_NOT_EMPTY(),
>                        ),
>
                       Field('area_name', 'string')
>                        migrate=True,
>                        format='%(area_value)s'
>                        )
>                        
>                        
>                        )
> But now it still Needs to be filtered. I'm sorry i this wasn't clear 
> enough at the beginning, sorry 
>

> You enter a number in "amount", choose an "area" and press "submit". Once 
> done, an db table records your "amount" and "area". 
>
> But the Options of the "area" are depending on a db table, giving out like 
> for example 5 records, 
> area_db = db(db.area.area_value == 1).select(db.area.ALL)
>
>
>
> <select id="0" class="test">    
>     {{x=0}}
>     {{y=0}}
>     {{for row in area_db:}} 
>     {{r = area_db[y].area_value
>       t = area_db[y].area_name
>      y = y+1
>      x= x+1}}<li><option value="r">{{=t}}</option></li>{{pass}}
> </select>
>
>
>
> How can i Combine it with an form, so i can enter an amount and submit 
> this for further use?
> Thanks, 
> Regards
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to