PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________

Hello List

I use the script below to check for required fields.  There are three
checkboxes on the form that, when checked, reveal additional fields. The
revealed fields then are also required, and the script should check them as
well. The checkboxes are field f11, field f16, and field f22

All is well with the script until it gets to the field f9. At that point it
won't continue unless field f11 has a check mark. (field f10 is required
only if field f11 has check mark in it.

If field f11 is checked, it continues with the revealed fields, then stops
UNLESS the next checkbox, field f16, is checked..

The script does not exhibit this behavior with the checkbox at field f22.
The script will continue whether that check box is checked or unchecked.

Everything looks fine to me, but obviously it is not. Can someone take a
look an see where the wheels are falling off.

Thanks


Kenn





 var cViewer = "Reader";
var nWarning = 1;
var cMsg1 = "Since you are using Acrobat Reader to fill out this form, you
won't be able to save or email it.";
var cMsg2 = "In order to save or email forms, you must use either Acrobat
Approval, or the full version of Acrobat software.";
// If Reader is being used, display message telling user that "Email" and
"Save Data" buttons don't work.
if (app.viewerType ==  cViewer)
 app.alert(cMsg1 +  cMsg2, nWarning);
else {
        f1 = this.getField("ad_no");
 f2 = this.getField("ad_desc");
 f3 = this.getField("run_date");
        f4 = this.getField("type_1");
 f5 = this.getField("cbogmm_spon");
 f6 = this.getField("cbodmm_spon");
 f7 = this.getField("cbo_dmm_finan_spon");
 f8 = this.getField("tbx_coop_dmm");
 f9 = this.getField("tbx_load_dmm");
 f10 = this.getField("tbx_share_dmm");
 f11 = this.getField("check_box_dmm_2");
 f12 = this.getField("cbo_dmm_2_finan_spon");
 f13 = this.getField("tbx_coop_dmm_2");
 f14 = this.getField("tbx_load_dmm_2");
 f15 = this.getField("tbx_share_dmm_2");
 f16 = this.getField("check_box_dmm_3");
 f17 = this.getField("cbo_dmm_3_finan_spon");
 f18 = this.getField("tbx_coop_dmm_3");
 f19 = this.getField("tbx_load_dmm_3");
 f20 = this.getField("tbx_share_dmm_3");
        f21 = this.getField("notes")
 f22 = this.getField("view_promag");
 f23 = this.getField("mag_pub_name");
 f24 = this.getField("mag_art_due");
 f25 = this.getField("mag_shipping");
 f26 = this.getField("spec_trim");
 f27 = this.getField("spec_live");
 f28 = this.getField("spec_bleed");
 f29 = this.getField("mag_contact");
 f30 = this.getField("mag_market");
 f31 = this.getField("mag_color");
 f32 = this.getField("req_by");
 f33 = this.getField("ad_coord");

          if (f1.value == "")
   {app.alert ('Please enter an ad number or type "TBD".');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f1.setFocus();}
  else if (f2.value == "")
   {app.alert ('Please enter an Ad Description.');
   if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
          // Version specific operation:
          f2.setFocus();}
  else if (f3.value == "")
   {app.alert ('Please enter a run date or type "TBD"');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f3.setFocus();}
            else if (f4.value == "Click to Select")
   {app.alert ('Please specify the type of request you are submitting.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f4.setFocus();}
  else if (f5.value == "_Click to Select a GMM" && f6.value == "_Click to
Select a DMM")
   {app.alert ('Please select an Ad Sponsor.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f5.setFocus();}
  else if (f7.value == "_Click to Select a DMM")
   {app.alert ('Please select a DMM Financial Sponsor.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f7.setFocus();}
  else if (f8.value == "Enter dollars or a % amount.")
   {app.alert ('Please enter a coop amount. If 0, please type none.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f8.setFocus();}
  else if (f9.value == "Enter a dollar amount.")
   {app.alert ('Please enter a load amount. If 0, please type none.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f9.setFocus();}
                else if (f11.value == 'Yes' )  {
     if (f12.value == "_Click to Select a DMM")
   {app.alert ('Please indicate the second DMM Financial Sponsor  \n or
uncheck the 2nd DMM checkbox.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f12.setFocus();}
  else if (f13.value == "Enter dollars or a % amount.")
   {app.alert ('Please enter a coop amount for the second DMM. \n If 0,
please type none.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f13.setFocus();}
  else if (f14.value == "Enter a dollar amount.")
   {app.alert ('Please enter a load amount for the second DMM. \n If 0,
please type none.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f14.setFocus();}
  else if (f10.value == "If shared, enter $ or % of portion.")
   {app.alert ('If shared, indicate what amount is shared by the first
DMM.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f10.setFocus();}
  else if (f15.value == "If shared, enter $ or % of portion.")
   {app.alert ('If shared, indicate what amount is shared by the second
DMM.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f15.setFocus();}
   else if (f16.value == 'Yes' )  {
       if (f17.value == "_Click to Select a DMM")
   {app.alert ('Please indicate the third DMM Financial Sponsor \n or
uncheck the 3rd DMM checkbox. ');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f17.setFocus();}
  else if (f18.value == "Enter dollars or a % amount.")
   {app.alert ('Please enter a coop amount for the third DMM. \n If 0,
please type none.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f18.setFocus();}
  else if (f19.value == "Enter a dollar amount.")
   {app.alert ('Please enter a load amount for the third DMM. \n If 0,
please type none.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f19.setFocus();}
  else if (f20.value == "If shared, enter $ or % of portion.")
   {app.alert ('If shared, indicate what amount is shared by the third
DMM.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f20.setFocus();}
   else if (f22.value == 'Yes' )  {
   if (f25.value == "Choose a Publication")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter the name of the publication.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f25.setFocus();}
  else if (f26.value == "")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter an artwork due date.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f26.setFocus();}
   else if (f27.value == "")
    {app.alert ('Please go to the Magazine/Special Publication and enter a
shipping method.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f27.setFocus();}
   else if (f28.value == "")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter a trim size.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f28.setFocus();}
   else if (f29.value == "")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter the "live" size.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f29.setFocus();}
   else if (f30.value == "")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter the "bleed" size.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f30.setFocus();}
   else if (f31.value == "Name, phone, email of Pub Contact")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter \n the name and phone number/email address of a contact at the
publication.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f31.setFocus();}
   else if (f32.value == "Market/Specify Store Logo")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter \n the markets and cps nameplate (store) logos required for this
ad.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f32.setFocus();}
   else if (f33.value == "")
    {app.alert ('Please go to the Magazine/Special Publication section and
enter the color.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f33.setFocus();}
   else if (f21.value == "Notes: ")
           {app.alert ('Please go to the "Notes" box and indicate the size
fo this ad, for example: full page, 1/2 page, 1/4 page, etc.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f21.setFocus();}
                        else if (f32.value == "")
    {app.alert ('The "Requested by" line cannot be blank. Please type the
name of the person requesting this ad.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f32.setFocus();}
   else if (f33.value == "Click to Select")
    {app.alert ('Please specify who approved this request.');
   if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
          // Version specific operation:
          f33.setFocus();}
            else
    // Email form and data.
    this.mailDoc(true, "[EMAIL PROTECTED]", "", "", "ROP Request Form
Submission");

  }
  else if (f32.value == "")
   {app.alert ('The "Requested by" line cannot be blank. Please type the
name of the person requesting this ad.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f32.setFocus();}
  else if (f33.value == "Click to Select")
   {app.alert ('Please specify who approved this request.');
          if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
          // Version specific operation:
          f33.setFocus();}
else
   // Email form and data.
   this.mailDoc(true, "[EMAIL PROTECTED]", "", "", "ROP Request Form
Submission");}}}


To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html

Reply via email to