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.
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: http://www.plupload.com/punbb/viewtopic.php?pid=11098#p11098 http://www.plupload.com/punbb/viewtopic.php?id=177
here is the js:
$(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 > 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;
});
});
here is the validation php:
//check for audience
$aud = (!empty($_REQUEST['aud'])) ? trim($_REQUEST['aud']): "";
here is the html:
<form id="myForm" method="post" action="plupload/examples/dump.php">
<div>
<h3>Please select an audience</h3>
<p><input class="age" type="radio" name="ageLimit" value="allAge"/> All ages </p>
<p><input class="age" type="radio" name="ageLimit" value="mature"/> Mature</p>
</div>
<br/>
<div id="transBox" style="display:none">
<div id="uploader">
<p>Your browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
</div>
</form>
I just now added this to the to check the value
$('#myForm input').on('click', function() {
alert($('input[name="ageLimit"]:checked', '#myForm').val());
});
but when I changed the js selectors to this below, again nothing was added to the DB.
$('input[name="ageLimit"]:checked', '#myForm').val()