Note that there are some explanatory texts on larger screens.

plurals
  1. PObootstrap modal set value of input field max attribute
    primarykey
    data
    text
    <p>I need to set the max attribute of input type max attribute on a bootstrap modal. I can do it via the <code>id</code> attribute but can not on max.</p> <p>Code :</p> <pre><code> &lt;!-- Modal --&gt; &lt;div class="modal fade" id="cartDialog" tabindex="-1" role="dialog" aria-labelledby="cartDialogLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h2 class="modal-title"&gt;Add to Cart&lt;/h2&gt; &lt;/div&gt; &lt;form method="GET"&gt; &lt;div class="modal-body"&gt; &lt;h3&gt;How many items would you like to order?&lt;/h3&gt; &lt;p&gt;&lt;b&gt;Inventory:&lt;/b&gt; &lt;input style="color:black" type="button" class="btn btn-link" id="inv" value=""&gt; &lt;b&gt;Expected Delivery Date:&lt;/b&gt; &lt;?php echo $expecteddeldate ?&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Quantity:&lt;/b&gt; &lt;input style="width:50px" min="1" type="number" name="qty" value="1" required&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt; &lt;input type="hidden" name="p" value="&lt;?php echo htmlspecialchars('add-cart') ?&gt;"&gt; &lt;input type="hidden" name="pid" id="pid" value=""&gt; &lt;button type="submit" class="btn btn-primary"&gt;ADD TO CART&lt;/button&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-dialog --&gt; &lt;/div&gt;&lt;!-- /.modal --&gt; &lt;script type="text/javascript"&gt; $(document).on("click", ".cartDialog", function () { var Inventory = $(this).data('inv'); $(".modal-body #inv").val( Inventory ); var pId = $(this).data('pid'); $(".modal-footer #pid").val( pId ); });&lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload