When the link is clicked it should pop up the dialog box when the download later button is clicked it toggles the checked variable of the button. Then closes the dialog button
I am new to Javascript and Jquery and have no idea what I am doing
$(function download_box(checkbox) {
// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
$( "#opener" ).click(function() {
$( "#dialog-download" ).dialog( "open" );
return false;
});
$( "#dialog-download" ).dialog({
autoOpen: false,
resizable: false,
height:140,
width:325,
modal: true,
buttons: {
"Download Now": function() {
var mycheckbox1 = document.getElementById(checkbox);
if(mycheckbox1.checked){
box.checked=false;
}
else{
box.checked=true;
}
$( this ).dialog( "close" );
},
"Download Later": function() {
$('#c2').prop("checked", true);
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
});
<form method="post" action="<?php echo $PHP_SELF;?>">
<a id="opener" href="#" OnClick="download_box('#c1')">db1.csv:</a>
<input id="c1" type="checkbox" name="download[]" value="db1.csv" />
<!-- ... -->
<input type="submit" value="submit" name="submit">
</form>