Note that there are some explanatory texts on larger screens.

plurals
  1. POform submit doesn't post text input field
    text
    copied!<p>I try to submit a form in eric martins simple modal. Everything works ok except that the form doesn't submit the quantity I put in a textfield. Does anyone have a neat solution for this?</p> <p>My Jquery UPDATED for a better view as asked in the post below</p> <pre><code> &lt;script type="text/javascript"&gt; function image_id_convert(image_id) { image_id = parseInt(image_id, 10).toString(35); while (image_id.length &lt; 6) { image_id = 'z' + image_id; } return image_id; } $('.opener').click(function (event) { var url = $(this).attr("href")+'/?format=json'; $('#formVariants').modal({ onOpen: function (dialog) { dialog.overlay.fadeIn('fast', function () { dialog.container.slideDown('fast', function () { dialog.data.fadeIn('fast'); }); }); }, onShow:function(dialog) { $.getJSON(url, function(data) { var contentHtml = ''; $.each(data.product, function(index, product){ var image = 'http://cdn.webshopapp.com/i/' + image_id_convert(data.product.image) + '/160x120x2/image.jpg'; contentHtml = '&lt;img src="' + image + '"/&gt;' + '&lt;div class="variantsContainer"&gt;' + '&lt;div class="pop_headerContainer"&gt;' + '&lt;div class="pop_title"&gt;&lt;h3&gt;' + data.product.fulltitle + '&lt;/h3&gt;&lt;/div&gt;' + '&lt;div class="pop_code"&gt;Artikelcode:' + data.product.code + '&lt;/div&gt;' + '&lt;div class="pop_price"&gt;€' + data.product.price.price + '&lt;/div&gt;' + '&lt;/div&gt;'; }); $.each(data.product.variants, function(index, variant){ contentHtml = contentHtml + '&lt;form class="formProduct" id="formProduct"&gt;' + '&lt;div class="variants"&gt;' + '&lt;div class="pop_variantTitle"&gt;&lt;label&gt;' + variant.title + '&lt;/label&gt;&lt;/div&gt;' + '&lt;div class="pop_variantQuantity"&gt;&lt;label"&gt;{{ 'Quantity' | t }}: &lt;input type="text" name="quantity" id="formProductQuantity" value="50" /&gt;&lt;/label&gt;&lt;/div&gt;' + '&lt;div class="pop_variantAdd"&gt;&lt;input type="submit" id="submit" class="button green" value="{{ 'Add to cart' | t }}"/&gt;&lt;/div&gt;' + '&lt;/form&gt;'; contentHtml = contentHtml + '&lt;/div&gt;'; // action="{{ 'cart/add/' | url }}' + variant.id + '" method="post" /* quantity = $('#formProductQuantity').val(); $('#formProductQuantity').val(quantity);*/ }); $('.formProductContent').html(contentHtml); }); } }); return false }) &lt;/script&gt; </code></pre>
 

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