dimanche 29 avril 2018

Bootstrap modal form not submitted

I was trying to submit form which is inside a modal.The modal will come dynamically.

<a href="#" data-toggle="modal"  id="getProduct" data-url="" data-target="#modal-quickview">

Here is the Modal form which will store the data

{!! Form::open(['method' => 'POST','class'=>'contact_dialog','route' => 'storeCart', 'enctype'=>'multipart/form-data']) !!}
  {!! Form::token(); !!}
    @if($product->category_id == '1')
            <div class="product-color-size-area">
              <div class="color-area">
                <h2 class="saider-bar-title">Color</h2>
                <div class="color">
                  <select class="single-option-selector" name="color">
                    @foreach($colors as $color)
                      <option value=""></option>                    
                    @endforeach
                  </select>
                </div>
              </div>
              <div class="size-area">
                <h2 class="saider-bar-title">Size</h2>
                <div class="size">
                  <select class="single-option-selector" name="size">
                     @foreach($sizes as $size)
                      <option value=""></option>                     
                    @endforeach
                  </select>
                </div>
              </div>
            </div>
    @endif    

     @if($product->category_id == '3')
            <div class="product-color-size-area">
              <div class="size-area">
                <h2 class="saider-bar-title">Size</h2>
                <div class="size">
                  <select class="single-option-selector" name="frame_size">
                     @foreach($frame_sizes as $frame_size)
                      <option value=""></option>                     
                    @endforeach
                  </select>
                </div>
              </div>
            </div>
    @endif 

     @if($product->category_id == '4')
            <div class="product-color-size-area">
              <div class="size-area">
                <h2 class="saider-bar-title">Size</h2>
                <div class="size">
                  <select class="single-option-selector" name="shoe_size">
                     @foreach($shoe_sizes as $shoe_size)
                      <option value=""></option>                     
                    @endforeach
                  </select>
                </div>
              </div>
            </div>
    @endif   

    <input type="hidden" name="product_name" value="">       
            <div class="product-variation">

                <div class="cart-plus-minus">
                  <label for="qty">Quantity:</label>
                  <div class="numbers-row">
                    <div onClick="var result = document.getElementById('qty'); var qty = result.value; if( !isNaN( qty ) &amp;&amp; qty &gt; 0 ) result.value--;return false;" class="dec qtybutton"><i class="fa fa-minus">&nbsp;</i></div>
                    <input type="text" class="qty" title="Qty" value="1" maxlength="12" id="qty" name="quantity">
                    <div onClick="var result = document.getElementById('qty'); var qty = result.value; if( !isNaN( qty )) result.value++;return false;" class="inc qtybutton"><i class="fa fa-plus">&nbsp;</i></div>
                  </div>
                </div>
                <button  class="button pro-add-to-cart submitForm" title="Add to Cart" type="submit"><span><i class="fa fa-shopping-cart"></i> Add to Cart</span></button>             
            </div>
    {!! Form::close() !!}

The problem here is when i tried to submit the data it doesn't call the route means nothing happened. What could be possible reason for form not submitting?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire