Why would you want to do this without a form? (it is eminently do-able, BTW, since it's a simple bit of Javascript, if I understand your question)
Without wrapping the whole thing in a form, however, and giving it a subit button to press, your values are never going to get as far as your server, never mind your database ;).
Unfortunately, the web is not an event-driven interface. The process goes like this:
A page is sent to the user's browser with a form containing various input types for them to fill out.
They fill ou the form and hit the submit button, and the whole lot gets sent back to the server.
These are the only two "events", as far as the server is concerned. You can have lots of stuff going on with Javascript,, while the page is sitting in the user's browser, but the server is completely unaware of them, until the values are finally submitted, at which point a static image of the values, as selected at the time of submission is sent.
Alright, I haven't answered your question, but I hope I've clarified the process, so that you can begin framing the next question ;).
|