1 Reply Latest reply on Oct 11, 2018 9:38 AM by shaunn92127499

    Required form field color change, save button and popup layering

    shaunn92127499 Level 1

      I posted a similar post but it was not in indesign as I wanted it to be in.

       

      Using latest version of InDesign, I'm trying to find out how to write some JS in order to change the default red border around a text field marked required.

       

      I have been unsuccessful so far with my code below. I have added it to the scripts user folder but when I run it I receive an error.

       

      if (event.value=="1") { event.target.fillColor = color.red } else if (event.value=="2") {   event.target.fillColor = color.green } else if (event.value=="3")  { event.target.fillColor = color.blue } else if (event.value=="4") { event.target.fillColor = ["RGB", 1, 1, 0]; } else { event.target.fillColor = color.white }

       

      Does anyone have an idea on how to change the colors dynamically once input is added to a field?

       

      Secondly, is there a way to add a button to save the pdf once it's filled out instead of clicking file/save, calling another method with JS that isn't well known that would call the save feature?

       

      Thirdly, I have several popups that when activated will show up behind input fields even though they are layered beneath the actual popup. Do they need to be in the same layer as the popup/button?

       

      Thanks in advance!