PDF Form - code to lock form fields on submit BUT NOT if *required fields are not complete


i have form has required fields , javascript required fields - example "if no selected make comments box required"

i'm using submit email button submit form... put in script lock fields make them read on submit.

 

the problem i'm having is, if required fields not complete when submit button clicked, notification pops required fields not complete, still locks form cannot go , add in other information.

 

so i'm looking if scenario.

 

1.     if required fields complete... lock fields , submit form

2.     if required fields incomplete... not lock or submit ... allow more information added

 

can me button code?

i'm javascript newbie please gentle me

 

thanks in advance

 

[moved non-technical forum lounge specific program forum... mod]

[here list of adobe forums... https://forums.adobe.com/welcome]

var ok = true;

var = 0;

for (i = 0; < this.numfields; i++){

try{

var f = this.getfield(this.getnthfieldname(i));

if(f.required==true){

if(f.value==""){

  ok=false;app.alert('missing value: '+f.name);

}

}

}catch(ex){};

};

if(ok==true){

for (var = 0; < this.numfields; i++){

var f = this.getfield(this.getnthfieldname(i));

f.readonly = true;

};

var = "you@domain.com";

var strurl = "mailto:"+to+"?subject=test&body=test&cc=&bcc=";

var submitas = "pdf";

this.submitform({curl: strurl, csubmitas:"pdf"});

};



More discussions in PDF Forms


adobe

Comments

Popular posts from this blog

Reader DC

AdobeIDの作り方

Adobe InDesign CC 2017 has stopped working