vendredi 18 septembre 2015

check box checked, download file and submit

I have a checkbox JSFIDDLE When the useR ticks on one of the checkboxes, it opens a new Window, which enables the user to view download a PDF once the checkbox button has been clicked. I want the download function to be disabled so when the user ticks on the checkbox button again it activates the submit button. Can this be done?

var checkboxes = $("input[type='checkbox']"),
submitButt = $("input[type='submit']");

checkboxes.click(function() {
submitButt.attr("disabled", !checkboxes.is(":checked"));
});

  checkboxes.click(function(e) {
    e.preventDefault (); 
    window.open('{site_url}downloads/resellers/Standard_Terms_and_Conditions.pdf');

    checkboxes[0].click();
        submitButt.attr("disabled", !checkboxes.is(":checked"));
});




Aucun commentaire:

Enregistrer un commentaire