Skip to main content
Known Participant
August 1, 2017
Answered

javascript: a button to undo, and a button to redo...easy

  • August 1, 2017
  • 6 replies
  • 1929 views

I'm still looking for help with this. One button to undo and one button to redo. Can someone provide a little help with this? I just can't find any javascript that will help me achieve these buttons. I have four text fields (total1, total2, total3, total4) and next to each I want to have the undo button and redo buttons for each total fields. Pretty basic. Like this, check box - click it to undo and if possible, to uncheck it to redo total1 field. And so on for the other three total fields. Or a second check box to redo total1. If you can help, please don't hesitate. Thank you.

This topic has been closed for replies.
Correct answer try67

Forget the terms "Undo/Redo", they are incorrect and not relevant to this issue.

I have already answered your question here: Re: need help with a button that would delete an amount, then to show it again?

Go over it again and you'll see that the solution I provided there is the right way to do what you're after.

6 replies

Legend
August 6, 2017

I asked you a question because I wanted you to answer. It was NOT a hint or suggestion. Because two entirely different solutions suggested themselves depending on your answer. You chose to ignore my attempt to help, instead. I take this as intolerably rude, but perhaps I'm out if touch. I'll try not to trouble you again.

Joel Geraci
Community Expert
Community Expert
August 5, 2017

I really don't understand the request. Are the total fields calculated? Are you just trying to force a recalculate?

pdfUser1Author
Known Participant
August 5, 2017

Hey Joel, all I'm trying to get help with is a check box that will do a Undo of a field and uncheck it and it will Redo. I need a little script that would enable me to click the box and the specific field (in this case it's the total1 field) will be removed from the calculation and uncheck it and it puts the amount back into the calculation.

Just like if you deleted a field information then went to Edit>Undo. The field information would then be returned to that field. I just don't want to go that route. I'd like to use a script. That's all I need.

Bernd Alheit
Community Expert
Community Expert
August 6, 2017

In your calculation you can check the value of the check box.

Legend
August 5, 2017

You're awfully quick to decide what will and won't help you for a person who admits he doesn't understand JavaScript and wants others to do his work for him. Well, good luck with that.

pdfUser1Author
Known Participant
August 5, 2017

I don't know who you are, but I just want to add this, I'm not wanting anyone to do the work for me. The basis of this site is to get help, discuss and offer help to those that are trying to learn javascript. Not to belittle and embrass those seeking help like you have chosen to respond with.

Your suggestion advice does not help. It was tried and you act surprised it was not correct answer.

I have to ask, please refrain from this sort of responding. It is not in the spirit of this site.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 6, 2017

Forget the terms "Undo/Redo", they are incorrect and not relevant to this issue.

I have already answered your question here: Re: need help with a button that would delete an amount, then to show it again?

Go over it again and you'll see that the solution I provided there is the right way to do what you're after.

Legend
August 5, 2017

Why don't you answer my question? Do the menu items do what you want (except for not being buttons)?

pdfUser1Author
Known Participant
August 5, 2017

because you are not answering my question or helping with what I want to do. I asked for how to attach a javascript to a button that would Undo/Redo a specific field. Easy. I already know that I can Undo/Redo found under the menu item Edit of the program. What you're suggesting but not what I'm asking. I was asking for help with a javascript that would do the same thing that I could attach to a check box. See the difference? You didn't answer what I was asking help with. I don't want to use the menu item. I want to use my own buttons. OK? I hope you understand now?

Inspiring
August 5, 2017

Exactly how are the field values of the total fields being set?

pdfUser1Author
Known Participant
August 5, 2017

Hello Mr Johnson, the values of the total fields are basic. Simple summing calculations. What I'm trying to do with the check box(s) is to name the total field in the javascript (total1) and with a click of the check box, Undo the total1 field, click and uncheck the check box and total1 will repopulate. I'm not trying to Reset the field, but to remove the named total1 field from the Grand Total of the total1, total2, total3 and total4 fields temporarily. Then to redo the total1 field amount if the check box is unchecked.

The problem is I don't know javascripting so I really don't know how to approach this. So, I have to ask for examples to learn from and see how will work. I don't want to use the Edit>Undo option in the Acrobat or Reader. I really would like to have these check boxes next to each total field and that would treat each total field with an individual Undo/Redo.

Thank you for your time, Mr Johnson.

Legend
August 1, 2017

Do the Undo and Redo menu items do what you wish (except for not being buttons)? (Don't use a browser!)

pdfUser1Author
Known Participant
August 5, 2017

I wasn't seeking suggestions. I'm familiar with my acrobat program enough to know the options. What I'm needing is a little bit of javascript to attach to a button to Undo and the other button is to Redo. That would be the option I'm needing.