0

I'm trying to have a confirm dialogue pop up once checkbox is selected. If confirm is true, leave checkbox checked; if false uncheck checkbox. I'm getting syntax errors on unrecognized expression for checkbox field. Any way to achieve this? Here is the code I've tried:

$(document).ready(function()
 {
     if($("[id$=#Submit_x0020_Form_x0020_to_x0020_4367902e-3204-4375-9a0e-52dabeae51e7_$BooleanField]").is(":checked")===true)
    {
        var i = window.confirm("Send form?");
        if (i==true)
        {
            $("[id$=#Submit_x0020_Form_x0020_to_x0020_4367902e-3204-4375-9a0e-52dabeae51e7_$BooleanField]").is(":checked",true);
        }
        else 
        {
            $("[id$=#Submit_x0020_Form_x0020_to_x0020_4367902e-3204-4375-9a0e-52dabeae51e7_$BooleanField]").is(":checked",false);
        }
    }

});
</script>  

And the error:

jquery-1.11.3.min.js:2 Uncaught Error: Syntax error, unrecognized expression: [id$=#Submit_x0020_Form_x0020_to_x0020_4367902e-3204-4375-9a0e-52dabeae51e7_$BooleanField]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.