bootstrap form is not getting submitted

I am using Bootstrap and trying to submit form to PHP page. But form not getting submitted.

<div class="container">   
  <div class="row">
    <div class="col-md-5 col-sm-12">
      <ul class="timeline" data-offset-top="3">
        <li>
          <div class="timeline-panel">
            <form name="Wall_Post" id="Wall_Post" action="/update.php"  method="post" role="form" enctype="multipart/form-data" class="facebook-share-box">
              <div class="timeline-body">
                <div class="share-form">
                  <ul class="post-types">
                    <li class="post-type">
                      <a class="status" id="shareType" href="#"><i class="fa fa-file"></i> Status</a>
                    </li>
                    <li class="post-type">
                      <a class="photos" id="shareType" href="#"><i class="fa fa-camera"></i> Photos</a>
                    </li>
                    <li class="post-type">
                      <a class="videos" id="shareType" href="#"><i class="fa fa-film"></i> Video</a>
                    </li>
                    <li class="post-type">
                      <a class="location" id="shareType" href="#"><i class="fa fa-map-marker"></i> Place</a>
                    </li>
                  </ul>
                  <div class="share">
                    <div class="arrow"></div>
                    <div><textarea name="message" cols="40" rows="10" id="status_message" class="form-control message" style="height: 62px; overflow: hidden;" placeholder="What's on your mind ?"></textarea> </div>

                    <div class="image hide">
                      <input type="file" class="form-control" name="image" id="image" />
                    </div>
                    <div class="video hide">
                      <input type="text" class="form-control" placeholder="Youtube or Vimeo video URL" id ="videoUrl" name="videoUrl"/>
                    </div>
                    <div class="place hide">
                      <input id="geocomplete" class="form-control" type="text" name="location" placeholder="Enter a location" />
                      <div class="map_canvas"></div>
                      <input type="hidden" name="lat" />
                      <input type="hidden" name="lng" />
                    </div>
                    <input type="hidden" name="shareType" class="shareType" value="status" />
                  </div>
                </div>
              </div>
              <div class="timeline-footer clearfix">
                <div class="pull-right">
                  <input type="submit" name="submit" value="Post" id="btn-share" class="btn btn-primary" />
                </div>
              </div>
            </form>
          </div>
        </li>
      </ul>
    </div>
  </div>     
</div>  

also I am using jquery v1.11.1 in my website, same code is working fine in other page where jquery v1.11.1 is not included. another thing i don't want to use ajax to submit form. is there any possibility ?

Answers 1

  • One error is that you have multiple instances of identical id's ("shareType") - I don't know if that's causing the problem - but you should change these to be unique ID's for each link. An example of the replicated id is in the following:

    <a class="status" id="shareType" href="#"><i class="fa fa-file"></i> Status</a>
    

Related Articles