3 Replies Latest reply on Aug 1, 2014 6:34 AM by Sajeev Sridharan

    indesign formular

    Dapeamel

      Hello people,


      I have wrote a function that creates a window

      I can also write anything in the window

       

      Could someone help me to add 2 more textfields in the formular

      so the user can write in 3 different fields?

       

       

      function Myfunction(){
      var myInput1=prompt("Write a number","","My new prompt");
      if(myInput1==null){
          exit();
      }
      
      
      
      
      if (myInput1){
      }else{
          alert("Du valde inte att skriva något jobbnummer");
      }
      }
      
      
      
      }
      
      
      

       

      I am not sure if prompt support this kind of method.

       

      Thank you in advance.

        • 1. Re: indesign formular
          Sajeev Sridharan Level 4

          Please refer Peter's Script UI manaul, it will be very helpful.

           

          www.kahrel.plus.com/indesign/scriptui-2-2.pdf

           

          Use edittext class instead of prompt (check page 9 in that PDF)

           

          Vandy

          • 2. Re: indesign formular
            Dapeamel Level 1

            I am using this one but I dont still find a answer.

            he uses all the time just 1 textfield in the prompts.

            • 3. Re: indesign formular
              Sajeev Sridharan Level 4

              Simple UI using Peters user guide, this may help you proceed further....

               

               

              var group1 = myPanel.add ("group");
              group1.add ("statictext", undefined, "textfield1: ");
              var textfield1 = group1.add ("edittext", [100,20,470,60], "");
              
              var group2 = myPanel.add ("group");
              group2.add ("statictext", undefined, "textfield2: ");
              var textfield2 = group2.add ("edittext", [100,20,470,60], "");
              textfield1.active = true;
              
              var OK_button = w.add ("button", undefined, "OK");
              
              OK_button.onClick = function () {
                  if(textfield1.text=="")
                  {
                      alert("textfield 1 is empty");
                  }
                  else
                  {
                      alert(textfield1.text);
                  }
              
              
                  if(textfield2.text=="")
                  {
                      alert("textfield 2 is empty");
                  }
                  else
                  {
                      alert(textfield2.text);
                  }
              }
              w.show();
              
              
              
              
              

               

               

              Vandy