I am in the process of changing a keyup event on a text field to reference a dropdown selection, in Rails. Here is the function call:

```
$(document).ready(function(){
    $('#survey_q1').keyup(calculate);
    $('#survey_q2').keyup(calculate);
    $('#survey_q3').keyup(calculate);
    $('#survey_q4').keyup(calculate);
    $('#survey_q5').keyup(calculate);
    $('#survey_q6').keyup(calculate);
});

function calculate(e)
{
    // Set each value as they come in
    var q1 = parseInt($('#survey_q1').val());
    var q2 = parseInt($('#survey_q2').val());
    var q3 = parseInt($('#survey_q3').val());
    var q4 = parseInt($('#survey_q4').val());
    var q5 = parseInt($('#survey_q5').val());
    var q6 = parseInt($('#survey_q6').val());
    // Don't do the calculation until all values are present
    if ( q1 > 0 && q2 > 0 && q3 > 0 && q4 > 0 && q5 > 0 && q6 > 0) {
        $('#survey_agent_score').val(
            parseFloat((((q2 + q3 + q4 + q5 + q6) + (1.5 * q1)) / 32.5) * 100).toFixed(2)
        );
    } else {
        $('#survey_agent_score').val('');
    }
}

```

Here is the view, as it stands before the change:

```
    <table>
        <h4>Survey</h4>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_q1">Question 1:</label></td>
            <td><input id="survey_q1" name="survey[q1]" style="width:60px;text-align:left;" type="text" class="required" value="<%= survey['q1'] %>" /></td>
        </tr>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_q2">Question 2:</label></td>
            <td><input id="survey_q2" name="survey[q2]" style="width:60px;text-align:left;" type="text" class="required" value="<%= survey['q2'] %>" /></td>
        </tr>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_q3">Question 3:</label></td>
            <td><input id="survey_q3" name="survey[q3]" style="width:60px;text-align:left;" type="text" class="required" value="<%= survey['q3'] %>" /></td>
        </tr>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_q4">Question 4:</label></td>
            <td><input id="survey_q4" name="survey[q4]" style="width:60px;text-align:left;" type="text" class="required" value="<%= survey['q4'] %>" /></td>
        </tr>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_q5">Question 5:</label></td>
            <td><input id="survey_q5" name="survey[q5]" style="width:60px;text-align:left;" type="text" class="required" value="<%= survey['q5'] %>" /></td>
        </tr>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_q6">Question 6:</label></td>
            <td><input id="survey_q6" name="survey[q6]" style="width:60px;text-align:left;" type="text" class="required" value="<%= survey['q6'] %>" /></td>
        </tr>
        <tr>
            <td style="vertical-align: top; text-align: right;"><label for="survey_agent_score">Agent Score:</label></td>
            <td><input id="survey_agent_score" name="survey[agent_score]" style="width:90px;text-align:left;background-color:#D6D6D6;" type="text" class="required" value="<%= survey['agent_score'] %>" readonly /></td>
        </tr>
    </table>

```

Here is the snippet I want to change the text fields to, in the view:

```
<td><%= select_tag "survey[q1]", options_for_select(Call::ANSWERS, @call.survey['q1']), promt: "Please select ..." %></td>

```

Here is the rendered HTML when adding the Rails snippet:

```
<td style="vertical-align: top; text-align: right;"><label for="survey_q1">Question 1:</label></td>
<td>
    <select id="survey_q1" name="survey[q1]" promt="Please select ..."><option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
    </select>
</td>

```

What this does is when I enter a numeric value into the text field, it calls the keyup event to do the calculation. Until all six (6) of the fields are filled out, it will display BLANK in the calculation text field. I want to change the text entered fields for the numeric value to a drop down listing of numbers. All the rest of the functionality I want to remain.

As far as the value saving, there is no issue there. The event does trigger using up/down/enter from the keyboard. It just not register the selection from mouse.