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

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

Engaged ,
Sep 28, 2016 Sep 28, 2016

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..............

TOPICS
Acrobat SDK and JavaScript , Windows
1.3K
Translate
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
Community Expert ,
Sep 29, 2016 Sep 29, 2016

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

Translate
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
Engaged ,
Sep 29, 2016 Sep 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..

Translate
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

I have solved it by hiding/showing the the fields by clicking it... but that is very time consuming... i have to making as many boxes and then in each of them i have to do hide/show stuff..... very time consuming.. i want a javascript .

Translate
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
LEGEND ,
Sep 29, 2016 Sep 29, 2016

Here's a link to a sample form that demonstrates the type of behavior you're looking for: http://acroscript.net/pdf/demos/multistate_4.pdf

It is intended to function as a multistate check box, so it includes a text field so you can get the value of the composite field (button + text) like you can with other field types. You'll have to study the JavaScript to see how it works. The text fields that hold the value would normally be set to hidden.

Translate
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

Thank you Mr. George... this is exactly what i want... but  i don't want so many fields to accomplish it...

I just want a text field or action button in which i can code a certain javascript to do it... bcoz i have atleast 500 checkboxes .. it will be very time taking .. if i follow. your method.... or show/hide field method.

Translate
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
LEGEND ,
Sep 29, 2016 Sep 29, 2016

It's possible to make it simpler using just buttons for each fake checkbox, but I don't have a demonstration of that. The basics of the coding is in the sample though. To create that many buttons and set them up with a script, I'd use JavaScript to create the buttons and set up the script in the Mouse Up event, like you see in that sample. Have you done much scripting in Acrobat?

Translate
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

sir ,

i have 500 checkboxes .. so i just want to make only 500 check boxes.. not more......plz suggest a way.. so that i can do it with 500 checkboxes...

i can even by a text box.... is it not possible  in a text box..... .

Translate
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
Community Expert ,
Sep 29, 2016 Sep 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.

Translate
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

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

Translate
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
Community Expert ,
Sep 29, 2016 Sep 29, 2016

If you want help you need to provide more details. What exactly is the issue? Did you try running it? If so, what were the results?

Translate
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

Sir,

Thank you for the trouble u took for me.. but somehow . it is not working for me..........

i want you to see this other problem i am facing. .......plz click the link below

I want a submit button which when clicked first lock the fields and if the button is clicked again t...

Translate
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
Community Expert ,
Sep 29, 2016 Sep 29, 2016

What does that request has to do with this one?

Translate
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

Actually i have completed the checkbox task by making 500 x 4 = 2000 checkboxes ...but now i have to make it non-editable when one submits it .... and  the owner can again edit if necessary but only with password..

Translate
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
Community Expert ,
Sep 29, 2016 Sep 29, 2016
LATEST

You need to set the fields as read-only and then prompt the user to enter the password using an app.response command.

Then, if the password is correct, loop other the fields once more and set the readonly property as false.

Translate
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