2 Replies Latest reply on Dec 1, 2010 10:43 AM by sicilianmissy65

    Help with creating form field that will only allow multiple of 6 to be entered

    sicilianmissy65

      I am working on a form and my boss has asked me to see if I can make the fields only accept multiple

      s of 6 (as it is a product order form and they come in packs of 6).  I think I will have to use javascript for this

      but am not yet familiar with writing these.  a friend mentioned something about 'validating' and that confused me even more.  I am reading a 5 inch

      book on using pdf forms, but thought I might be able to get a quicker response here with all of you wonderful people and then narrow my search in my book to learn about it more by what responses I may get here.

       

      I REALLY APPRECIATE ANY HELP!!!

       

      Hope you all had a wonderful Turkey Day!

      Thanks in advance!

       

        • 1. Re: Help with creating form field that will only allow multiple of 6 to be entered
          try67 MVP & Adobe Community Professional

          Your friend was right, you do need a validation script. The way to do it is to use the modus operator (%) and then look at the result of the number entered mod 6. If it's not 0, then the number entered is not a multiple of 6. Try this as the validation script of a text field set as a number:

           

          if (event.value!=null && event.value!="") {
              if ((Number(event.value)%6)!=0) {
                  app.alert("You must enter a multiple of 6.");
                  event.rc = false;
              }
          }

          • 2. Re: Help with creating form field that will only allow multiple of 6 to be entered
            sicilianmissy65 Level 1

            Thank you so much!!! I copied and pasted your script into my validation area in properties of the filed an

            d it worked great!!!

             

            However, I don't really understand what you said!  lmao!

            Are there any training videos here on this site you might recommend or where I would begin to learn how to do this and understand it!

            I feel so stupid, but I guess the only stupid thing is not asking and trying to learn more! right!?

             

            I really appreciate you sending me that script!  At least for now, I can finish this form.

            Woohoo!  You are amazing!

            Thank you again!!!!

            Dena