Saving value of a selection option in comment form as comment meta

In a plugin that I am writing I need to let user choose an option from a dropdown list before they post a comment. I used the comment_form action and inserted a drop down into the comment form.

 * Modify the comment to add our custom left and right dropdown
function modify_comment_form($post_id) {
    echo "
    <label class='comment'>Choose your side:</label>
    <select id='tallytree_side' name='tallytree_side'>
        <option selected='selected' value='neutral'>Neutral Comment</option>
        <option value='left_answer'>" . $this->get_left_answer() . "</option>
        <option value='right_answer'>" . $this->get_right_answer() . "</option>
add_action('comment_form', 'modify_comment_form');

Which looks like this:

enter image description here

Now I just need to be able to save the value of this dropdown list when the comment is posted as a meta data of this particular comment. Note that this is a plugin and I dont want to modify core wordpress files as suggested in a tutorial here. I found a relevant discussions on the wordpress forum but I still could not find the answer I was looking for.

How can I save the selected option value as a comment meta in wordpress database?

Do I need to use AJAX for this or can this be achieved by simply using an action or filter that I could use to retrieve the value of the dropdown menu?

Solutions Collecting From Web of "Saving value of a selection option in comment form as comment meta"

You can use the function update_user_meta for logged in users and the php function setcookie for the visitors. Here is a start how to work with update_user_meta

You can run this function on submission of the form or by running it by AJAX, i would recommend you to run it with AJAX.

function wpse_update_user_commentform() {

     * Get values from the selected
     * Dropdown as tha variable $side
     * Change this to your dropdown name

    $side = $_POST['dropdown'];

    $comment_id = get_comment_ID();

    // Update the comment meta "comment_side" to the selected value
    update_comment_meta( $comment_id, 'comment_side', $side );