/ Id-Extras Forum / Connecting function to specific group in dialog box

  • Author
  • #6173 Reply
    Wonderboy
    Participant

      I have a dialog box with multiple groups and each group has a radio buttons. as you can see in the attached photo, there is a few radio groups. here is the code i have been messing with…

      Code:
      // ===========
      var ColorBtnGrp = colorInfoPnl.add(“group”, undefined, {name: “ColorBtnGrp”});
      ColorBtnGrp.orientation = “column”;
      ColorBtnGrp.alignChildren = [“left”,”top”];
      ColorBtnGrp.spacing = 10;
      ColorBtnGrp.margins = 0;

      var CMYK = ColorBtnGrp.add(“radiobutton”, undefined, undefined, {name: “CMYK”});
      CMYK.text = “CMYK”;

      var spotsOnly = ColorBtnGrp.add(“radiobutton”, undefined, undefined, {name: “spotsOnly”});
      spotsOnly.text = “Spots Only”;

      var blackSpots = ColorBtnGrp.add(“radiobutton”, undefined, undefined, {name: “blackSpots”});
      blackSpots.text = “Black + Spots”;

      var blackOnly = ColorBtnGrp.add(“radiobutton”, undefined, undefined, {name: “blackOnly”});
      blackOnly.text = “Black Only”;

      ColorBtnGrp.children[0].value = true;
      function colorGrpBtns (colorBtn) {
      for (var i = 0; i < colorBtn.children.length; i++) { if (colorBtn.children[i].value == true) { alert(colorBtn.children[i].text) return colorBtn.children[i].text; } } }

      how to i connect this function to this specific group?

      if needed i can provide full script but its about 250 lines and mostly just dialog right now

      #6330 Reply
      Wonderboy
      Participant

        i figured it out. i just made an if statement for every radio button. if the value is true, then make that layer show

        Code:

        if(dialog.show()==1){

        var customer = myEvent.target.textFrames.itemByName(“customer name”);
        customer.contents = customerInput.text

        if(unwind1.value == true){
        myEvent.target.layers.itemByName(“Unwind 1”).visible = true;
        var unwind1layer = myEvent.target.layers
        }

        if(unwind2.value == true){
        myEvent.target.layers.itemByName(“Unwind 2”).visible = true;
        var unwind2layer = myEvent.target.layers
        }

        if(unwind3.value == true){
        myEvent.target.layers.itemByName(“Unwind 3”).visible = true;
        var unwind3layer = myEvent.target.layers
        }

        if(unwind4.value == true){
        myEvent.target.layers.itemByName(“Unwind 4”).visible = true;
        var unwind4layer = myEvent.target.layers
        }
        }

        #6331 Reply
        Wonderboy
        Participant

          right now i have this script working good, but it only effects the pages in the layout, not the master page. is there a way to have it effect the master page?

          below is the function i call. Is it possible to change Document to MasterPage or something like that?

          Code:
          function myOpenFunction(myEvent){

          if(myEvent.target instanceof Document){

          #6332 Reply
          ~~Ariel~~
          Participant

            What is the “myEvent” variable?

          Viewing 4 posts - 1 through 4 (of 4 total)
          Reply To: Connecting function to specific group in dialog box
          Your information: