Skip to main content
rakeshk21205956
Inspiring
September 29, 2016
Question

I want a field in Adobe acrobat in which when i click once it show "+", when twice it show "-" and when click thrice blank

  • September 29, 2016
  • 1 reply
  • 1468 views

Sir / Madam,

I am making a form in which i want a field in which when i click once it should show "+", when clicked twice it shows "-" and so on..............

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 29, 2016

What does "and so on" mean? What should happen if it's clicked a third time?

rakeshk21205956
Inspiring
September 29, 2016

it should toggle between different characters i want...

like if i have 10 different characters.. then it should toggle between 10 of them.. while clicking on them.

Like on first click 1st character , second click 2nd character.. .till 10th and after that blank  and again.... 1st character..

rakeshk21205956
Inspiring
September 29, 2016

Here, I wrote for you a code that will allow you to cycle through a list of any number of characters. You need to place it as the MouseUp event of your button field (and set the caption to the first item in the list):

var values = ["+", "-", "/", "*", "?", "!"]; // etc.

var currentSymbolIndex = values.indexOf(event.target.buttonGetCaption());

if (currentSymbolIndex==values.length-1)

    event.target.buttonSetCaption(values[0]);

else event.target.buttonSetCaption(values[currentSymbolIndex+1]);

You can put that code in a function as a doc-level script and then just call it from each one of your fields. That way you can update the list in a single location and it will apply to all of them.


thanks for your reply... but i am not able to get it...