Warning and disable submit button when check box not ticked

New Here ,
Nov 25, 2020

Copy link to clipboard

Copied

Hi There,

I need to add a JS on adbole fillable form on submit button. when Checkbox1 is not ticked give a warning an desable submit button, when check box is ticked submit button enables to email the form.

appreciate your help.

 

Dee

Adobe Community Professional
Correct answer by ls_rbls | Adobe Community Professional

You can add the line below to your original script or as an additional Mouse-Up event in the same button field like:

 

var f = this.getField("Checkbox1");

var check = (f.isBoxChecked(0)) ? this.mailDoc({cTo: "justMe@mailMe.com"})  : app.alert("Please see Disclaimer at the bottom of this page and check the box to confirm that you understand the required approvals prior to submitting this request");

 

TOPICS
Acrobat SDK and JavaScript, PDF forms

Views

49

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Warning and disable submit button when check box not ticked

New Here ,
Nov 25, 2020

Copy link to clipboard

Copied

Hi There,

I need to add a JS on adbole fillable form on submit button. when Checkbox1 is not ticked give a warning an desable submit button, when check box is ticked submit button enables to email the form.

appreciate your help.

 

Dee

Adobe Community Professional
Correct answer by ls_rbls | Adobe Community Professional

You can add the line below to your original script or as an additional Mouse-Up event in the same button field like:

 

var f = this.getField("Checkbox1");

var check = (f.isBoxChecked(0)) ? this.mailDoc({cTo: "justMe@mailMe.com"})  : app.alert("Please see Disclaimer at the bottom of this page and check the box to confirm that you understand the required approvals prior to submitting this request");

 

TOPICS
Acrobat SDK and JavaScript, PDF forms

Views

50

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 25, 2020 0
Adobe Community Professional ,
Nov 25, 2020

Copy link to clipboard

Copied

You can add the line below to your original script or as an additional Mouse-Up event in the same button field like:

 

var f = this.getField("Checkbox1");

var check = (f.isBoxChecked(0)) ? this.mailDoc({cTo: "justMe@mailMe.com"})  : app.alert("Please see Disclaimer at the bottom of this page and check the box to confirm that you understand the required approvals prior to submitting this request");

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 25, 2020 0
Adobe Community Professional ,
Nov 26, 2020

Copy link to clipboard

Copied

It doesn't look like JavaScript…

 

 

$('#submit').prop("disabled", true);
$('input:Checkbox1').click(function() {
if ($(this).is(':checked')) {
$('#submit').prop("disabled", false);
} else {
if ($('.checks').filter(':checked').length < 1){
$('#submit').attr('disabled',true);}
}
});

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 26, 2020 1
ls_rbls LATEST
Adobe Community Professional ,
Dec 19, 2020

Copy link to clipboard

Copied

Thank you for catching that JR. 

 

I should've clarified to delete that script and use the example Mouse-up event above.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 19, 2020 0