-2

提交以下引导表单时,我在服务器端得到空值数组:

<form id="target" action="/Insert_Room" method="post" class="form-horizontal form-label-left" novalidate>
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12">Room-Name</label>
          <div class="col-md-9 col-sm-9 col-xs-12">
            <input type="text" class="form-control" placeholder="202-A/C-AttachBath">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12">Room-Prize</label>
          <div class="col-md-9 col-sm-9 col-xs-12">
            <input type="text" class="form-control" placeholder="Prize...">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12">Comments</label>
          <div class="col-md-9 col-sm-9 col-xs-12">
              <textarea class="form-control" rows="3" placeholder='Room Comments'></textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-6 col-md-offset-3">
            <button type="submit" class="btn btn-primary">Cancel</button>
            <button id="send" type="submit" class="btn btn-success">Submit</button>
          </div>
        </div>
      </form>
4

1 回答 1

0

正如我所看到的,您没有将**name**属性赋予任何输入标签或文本区域。必须为**name**每个输入标签和文本区域赋予属性以提交值并在提交的页面上获取这些值。

所以只需**name**像这样添加每个属性:

<input type="text" name="name" /> //you can add other attributes also

记住:name 属性必须是唯一的。

于 2016-12-27T10:53:32.683 回答