get all values from select play framework

时间:2015-07-28 23:02:31

标签: java html scala playframework

I have form with select item, which I'm filling on client side.

    <table>
        <td>
            <tr>
                <input type="text" id="textValue">
            </tr>
            <tr>
                <button type="button" onclick="insertVal()">Insert option</button>
            </tr>
        </td>
        <td>
                <select id="properties" size="6" name="properties" multiple>
                </select>
        </td>
    </table>
<script>
    function insertVal() {
        var x = document.getElementById("properties");
        var option = document.createElement("option");
        option.text = document.getElementById("textValue").value;
        x.add(option, x[0]);
        document.getElementById("textValue").value = "";
    }
</script>

I need to get this values in java code in my controller. I tried something like this, but it passes only selected value.

DynamicForm requestData = Form.form().bindFromRequest();
Logger.info(requestData.get("properties"));

0 个答案:

没有答案