i’ve a from an i want to fill it automatically based on information from a data base and filled fields :
in db_wizard.py
db.define_table('sender',
Field('name'), # e.g. Daniel
Field('email'),# e.g. daniel@daniel.com
Field('opening'), # e.g. Dear Daniel
...)
db.define_table('receiver',
Field('name'), # e.g. John
Field('email'), # e.g. John@john.com
Field('tel'), # e.g. 111 222 111
...)
db.define_table('letter',
Field('sender', db.sender.id), # e.g. Daniel
Field('receiver', db.receiver.id), # e.g. John
Field('opening'), # should be filled automatically when choosing/changing the value of "sender"
...)
so letter.opening should get the value of receiver.opening[letter.sender.id], that means the value of opening of the chosen sender
If the ‘opening’ text should be filled in instantly when the user selects a recipient, then you’ll probably want to use Ajax. Check out this lazy options widget. You’ll have to modify it to fill in a string input instead of an options list, but otherwise it should do what you want.