Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy am I getting "undefined" passed to the db? jquery php plupload
    primarykey
    data
    text
    <p>I am NOT having trouble passing something into my database, so the "may have already been answered" alert above and the associated link do not answer my question (Thanks for trying to help anyway). My problem is with the jquery variable. </p> <p>Why is it when I pass <code>$('input[name="ageLimit"]:checked', '#myForm').val()</code> to the alert the variable pulls the correct information, but when I pass it to the url in the plupload function it does not and I end up with <code>undefined</code> in my database. Why might this be happening? permissions? jquery conflict? </p> <pre><code>&lt;script type="text/javascript"&gt; // Convert divs to queue widgets when the DOM is ready $(document).ready(function(){ $('#myForm input').on('click', function() { alert($('input[name="ageLimit"]:checked', '#myForm').val()); }); }); $(function() { $("#uploader").plupload({ // General settings runtimes : 'flash,html5,browserplus,silverlight,gears,html4', url : 'upload.php?aud=' + $('input[name="ageLimit"]:checked', '#myForm').val(), 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; }); }); &lt;/script&gt; </code></pre> <p>here is the php code</p> <pre><code>//check for audience $aud = (!empty($_GET['aud'])) ? trim($_GET['aud']): ""; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    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