表格提交失败

时间:2014-09-19 08:47:22

标签: html jsp servlets

我正在尝试使用JSP / Servlets向后端提交表。

我做了什么:

我已将表数据嵌入表单中。

问题:

我没有将数据发送到后端。 (我试图做一个sysout)

我获取了下拉列表的默认值(但不是我选择的值)

代码:

<div class="container">
<form method="POST" action="hello2">
    <div class="row clearfix">
        <div class="col-md-12 table-responsive">
            <table class="table table-bordered table-hover table-sortable" id="tab_logic">
                <thead>
                    <tr >
                        <th class="text-center">
                            Age
                        </th>
                        <th class="text-center">
                            Gender
                        </th>
                        <th class="text-center">
                            Interest
                        </th>
                        <th class="text-center">
                            Language
                        </th>
                        <th class="text-center">
                            Threshold
                        </th>
                        <th class="text-center">
                            Options
                        </th>
                        <th class="text-center" style="border-top: 1px solid #ffffff; border-right: 1px solid #ffffff;">
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr id='addr0' data-id="0" class="hidden">
                        <td data-name="age">
                            <select name="age">
                                <option value"">Select Age</option>
                                <option value"1">Any</option>
                                <option value"2">Less than 21</option>
                                <option value"3">Greater than 21</option>
                            </select></td>
                        <td data-name="gender">
                            <!-- <input type="text" name='mail0' placeholder='Email' class="form-control"/> -->
                            <select name="gender">
                                <option value"1">Any</option>
                                <option value"2">Male</option>
                                <option value"3">Female</option>
                            </select>
                        </td>
                        <td data-name="interest">
                            <!--<textarea name="desc0" placeholder="Description" class="form-control"></textarea> -->
                            <select name="interest">
                              <option value="sports">Sports team</option>
                              <option value="book">Book</option>
                              <option value="band">Musician/band</option>
                              <option value="tv">TV Show</option>
                              <option value="restaurant">Restaurant/cafe</option>
                              <option value="movie">Movie</option>
                            </select>
                        </td>
                        <td data-name="language1">
                            <select name="language">
                              <option value="english">English</option>
                              <option value="spanish">Spanish</option>                            
                              <option value="italian">Italian</option>
                            </select>
                        </td>
                        <td data-name="threshold1">
<!--                            <input type="text" name="threshold" placeholder="Threshold" class="form-control"/> -->
                            <input type="text" name="threshold" placeholder="Threshold" class="form-control">
                        </td>
                        <td data-name="del">
                            <button nam"del0" class='btn btn-danger glyphicon glyphicon-remove row-remove'></button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <a id="add_row" class="btn btn-default pull-left">Add Row</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" class="btn btn-success pull-right" value="Submit"/>
    </form>
</div>

1 个答案:

答案 0 :(得分:0)

<form method="POST" action="hello2.jsp">