I am a novie in coding. Please help me out.
How to create a drop down form that shows the user the data specific to a record?
For example, in this code I have the data stored for a number of cricket players. In this drop down list, I want to just show the data specific to the player chosen from the drop down menu.
def index(): return dict(message="hello from view_data.py")
def view_data() :
form=SQLFORM.factory(Field('Name',requires=IS_IN_DB(db,'Cricket.Name')))
if form.accepted:
response.flash='Viewing Selected Data'
records=SQLTABLE(db().select(db.Cricket.ALL)) // This is the part where the problem lies. I don't know how to pass the 'Name' that has been selected.
return dict(form=form, record=records)
response.menu=[['View Player Data', False, URL(view_data)]]