Venukanth
Venukanth

Reputation: 11

This form not submit post values

I get the empty array of values in server side when submit the following bootstrap form:

<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>

Upvotes: -2

Views: 70

Answers (1)

Code Lღver
Code Lღver

Reputation: 15593

As I can see you have not given the **name** attribute to any input tag or textarea. It is mandatory to give the **name** attribute to each input tag and textareas to submit the values and to get these values on submitted page.

So just add the **name** attribute with each like this:

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

Remember: name attribute must be unique.

Upvotes: 0

Related Questions