• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Required form field color change, save button and popup layering

New Here ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

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!

TOPICS
Scripting

Views

275

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines