Ask HN: Difficult Form Problem
On Facebook, when you make a question, users can make their own answer to the poll. I was wondering how to do exactly that. How do I make a poll where users can make their own option?
Then on the backend, if the extra radio button was selected, instead of incrementing the vote count for that answer, you create a new answer in the database with a vote count of 1.
I assume you have your answers stored in a table like the following (pseudo-sql, my sql is rusty):
CREATE TABLE answers (
question_id INTEGER NOT NULL,
answer_id INTEGER NOT NULL,
answer_total_votes INTEGER DEFAULT 1,
answer_text TEXT NOT NULL,
PRIMARY KEY (question_id, answer_id)
)