I got the jQuery autocomplete form mostly working how I need it to work here: http://problemio.com/test.php
but there is one problem: I can’t get the area where the chosen items are listed to be a form field. Right now it is just some uneditable text area and when I try to do a
var log = $("#log").val();
that gets nothing in the value, so I can’t really submit it.
1) How do I make that area into a form field whose value can be retrieved upon form submission?
2) Also, how do people manage to allow the users to remove the items they had chosen?
Thanks!!
You can’t get the value of a
divelement (there isn’t one). That’s what you’re trying to do in your #add_category click handler on line 75 ($("#log").val()— #log is a div)You need to get the html or text from the div:
OR
You can just change the html of the
logarea with a textarea: