PDF Form JavaScript to Limit number of Check Box Selection | Adobe Acrobat Form JavaScripts

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 19

  • @sangeriz
    @sangeriz 3 ปีที่แล้ว +1

    Thank you! this video is great!

  • @MahmoudMeky
    @MahmoudMeky 3 ปีที่แล้ว

    Thanks so much ❤️
    You are amazing

  • @nazrulislam-kf5wu
    @nazrulislam-kf5wu 3 ปีที่แล้ว

    Thank you so much. :)

  • @laas4642
    @laas4642 ปีที่แล้ว

    I am trying to do this with lower 0 and upper 21 (22 options), max 10 selected. How do I alter the script for a double-digit maximum? Currently, the script is running as soon as I select one checkbox.

    • @pdfform
      @pdfform  ปีที่แล้ว

      mssg on our patreon page

  • @umar32bright
    @umar32bright 3 ปีที่แล้ว +1

    i need your help sir.

  • @natim4936
    @natim4936 3 ปีที่แล้ว

    Im getting a syntax error missing ; before statement 3: at line 4
    I wrote it as for (var i = lower; i < upper+1; i++) {
    Did I miss something?

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @Nati M. if its showing error then there must be some mistakes..... please check ur script thoroughly with video each line

  • @amarketing55
    @amarketing55 3 ปีที่แล้ว

    Hello, it is not working for me. Please explain why you copy and pasted LimitCB (0,5,3); what do the 0, 5 and 3 signify?

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      0 is the first field's suffix, 5 is the last field suffix and 3 is max no. selection

    • @amarketing55
      @amarketing55 3 ปีที่แล้ว

      @@pdfform
      Please see below. Did I do something wrong?
      function LimitCB(lower, upper, ms) {
      var cnt = 0;
      for (var i = lower; i < upper+1; i++) {

      if (this.getField("cHob." + i).value !== "Off") cntt;
      if (cnt > ms) {
      event.target.value = "Off";
      app.alert ("You may only choose one option for this row."+ "/n/n" + "NOTE: You can only select " + ms+ "one option.", 1);
      break;
      }
      }
      }

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @@amarketing55 fourth line you hve written cntt instead of cnt++

    • @amarketing55
      @amarketing55 3 ปีที่แล้ว

      @@pdfform Thank you. So if I have 20 boxes and only want to allow 1 selection instead of 3, would I write LimitCB (0,20,1);

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      if u want only 1 selection just use Radio buttons... no need to use checboxes