I have a drop-down menu created from a field in my DB using SQLForm.factory. How can I assign an Ajax function to the onchange event of the drop-down menu?
The drop-down menu is created from a table called "cities" by: form = SQLFORM.factory(Field('City', requires=IS_IN_DB(db, 'cities.id', '%(name)s',error_message='Please select a city', zero=None)), submit_button='Next') I would like to have an ajax function that has the city selected from the drop-down menu as a parameter and is run every time the selection changes. Something like: onchange="ajax('function_name', ['City'], 'target_div');" Any help would be appreciated. Thanks.