It took me some time to get the server-side code behind the following form
working. If you want to do something similar, this post may be of use.
I welcome comments and would be happy to rewrite my code and this example based
on them.
There are two Postgres tables