The proximate cause of the error is `id` is not submitted with the form. There may be an easier way that would eliminate the code that is presumably duplicated between index and buy/sell.

The [button element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button) has an attribute `formaction` that will override the `action` attribute of the form attribute.