Note that there are some explanatory texts on larger screens.

plurals
  1. POplupload radio button input jquery selector only pulls first value
    primarykey
    data
    text
    <p>Using the UI widget, I have the input posting to the mysql database BUT only the first radio choice is ever pulled. I am currently using the selector: ('input:radio[name="ageLimit"]'), but no luck.</p> <p>Can anyone point me to some info on how to get the other radio value, please? Here are the links I have been drawing my info from: <a href="http://www.plupload.com/punbb/viewtopic.php?pid=11098#p11098" rel="nofollow">http://www.plupload.com/punbb/viewtopic.php?pid=11098#p11098</a> <a href="http://www.plupload.com/punbb/viewtopic.php?id=177" rel="nofollow">http://www.plupload.com/punbb/viewtopic.php?id=177</a></p> <p>here is the js:</p> <pre><code> $(function() { $("#uploader").plupload({ // General settings runtimes : 'flash,html5,browserplus,silverlight,gears,html4', url : 'upload.php', max_file_size : '1000mb', max_file_count: 20, // user can add no more then 20 files at a time chunk_size : '1mb', rename: true, multiple_queues : true, multipart_params : { aud : $('input[name="ageLimit"]').val() }, // Resize images on clientside if we can //resize : {width : 320, height : 240, quality : 90}, // Rename files by clicking on their titles rename: true, // Sort files sortable: true, // Specify what files to browse for filters : [ {title : "Image files", extensions : "jpg,gif,png"}, {title : "Zip files", extensions : "zip,avi"} ], // Flash settings flash_swf_url : 'plupload/js/plupload.flash.swf', // Silverlight settings silverlight_xap_url : 'plupload/js/plupload.silverlight.xap' }); // Client side form validation $('form').submit(function(e) { var uploader = $('#uploader').plupload('getUploader'); // Files in queue upload them first if (uploader.files.length &gt; 0) { // When all files are uploaded submit form uploader.bind('StateChanged', function() { if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) { $('form')[0].submit(); } }); uploader.bind('BeforeUpload', function(up) { up.settings.multipart_params.aud = $('input[name="ageLimit"]').val(); }); uploader.start(); } else alert('You must at least upload one file.'); return false; }); }); </code></pre> <p>here is the validation php:</p> <pre><code> //check for audience $aud = (!empty($_REQUEST['aud'])) ? trim($_REQUEST['aud']): ""; </code></pre> <p>here is the html:</p> <pre><code>&lt;form id="myForm" method="post" action="plupload/examples/dump.php"&gt; &lt;div&gt; &lt;h3&gt;Please select an audience&lt;/h3&gt; &lt;p&gt;&lt;input class="age" type="radio" name="ageLimit" value="allAge"/&gt; All ages &lt;/p&gt; &lt;p&gt;&lt;input class="age" type="radio" name="ageLimit" value="mature"/&gt; Mature&lt;/p&gt; &lt;/div&gt; &lt;br/&gt; &lt;div id="transBox" style="display:none"&gt; &lt;div id="uploader"&gt; &lt;p&gt;Your browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.&lt;/p&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>I just now added this to the to check the value</p> <pre><code>$('#myForm input').on('click', function() { alert($('input[name="ageLimit"]:checked', '#myForm').val()); }); </code></pre> <p>but when I changed the js selectors to this below, again nothing was added to the DB.</p> <pre><code>$('input[name="ageLimit"]:checked', '#myForm').val() </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.
 

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