Hi,

I would like to have a table field 'autofill' a value based on another
field's choice. I would like to have a link displayed depending on the
user's server name choice. something like this (but obviously this is
wrong ;) )

this is the table definition (the last validation line is the issue):

db.define_table('build',
                Field('title'),Field('description',length=256),
 
Field('category',requires=IS_IN_DB(db,db.category.name)),
                Field('date','date',default=datetime.datetime.now()),
 
Field('URL','text'),Field('buildServer',requires=IS_IN_DB(db,db.buildserver.name)))

db.category.name.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'category.name')]
db.build.title.requires=[IS_NOT_EMPTY()]
db.build.description.requires=IS_NOT_EMPTY()
db.build.category.requires=IS_IN_DB(db,'category.id','category.name')
db.build.date.requires=IS_DATE()
db.build.URL='http://{0}/blueLite/default/
index.html'.format(db.build.buildServer)



if the user fills the form, and chooses a server from the
'buildServer' field, I would like the 'URL' field to autofill with the
user's server choice as variable. So something like the last
validation line above ( db.build.URL='http://{0}/blueLite/default/
index.html'.format(db.build.buildServer) )

Any ideas how this can work?

thanks,
Mart :)

Reply via email to