![how to strikethrough text in adobe acrobat pro how to strikethrough text in adobe acrobat pro](https://clickup.com/blog/wp-content/uploads/2020/10/image2-6.gif)
the box to change is called Shipping and the to other fields to check are subtotal and customer #. First I am trying to change the contents of a text box depending on 2 other fields. What exactly you do to validate the form depends on your specific form, and there is no general purpose function that you can use. This is done by either marking the text fields that need information as “required”, or by providing your own validation mechanism that gets executed when the user clicks on the “Submit” button.
![how to strikethrough text in adobe acrobat pro how to strikethrough text in adobe acrobat pro](https://highlightsapp.net/img/mac/document-text-selection.png)
What you can do is prevent somebody from submitting your form if it’s not complete. So, preventing somebody from saving your form is a bad idea, and from a technical point of view also not possible. I may even close the document if I know that it will take a few days to get the missing information. In this case, I would save the document (and potentially leave it open, but I want to make sure that the information I’ve already entered cannot get lost), retrieve the information and then continue. The save function always works, and in my opinion, it’s a good thing that it aways works: I may start to fill out a form, but may need more information. To learn more about the event object, take a look at – make sure to click on the button in the upper left corner to display the navigation pane if it’s not shown You cannot do that. There are other ways to highlight the field in question besides changing the text color, the border color or the fill color could be changed instead, or in addition, just make sure that you are not making the form impossible to read. So, having a text field contain that error message might be a good idea. Using this method has implications on the form submission process: The form no longer can verify that the data is correct, so the submission function needs to do another round of validation to see if any of the required fields are not correct (one way to do that is to test all relevant fields to see if the text color is using the error color, or we can use global variables to store the validation state).Īnother thing I like to do is to display the validation error message on the form in an otherwise hidden field: The problem with our last solution is that if the user saves a partially filled form, and picks it up at a later time, that error message that popped up is long gone, and the only indication that there is something wrong with the form is the modified field color. This is not always desired (for more complicated data, it will probably be much easier to take a look, correct that one typo and continue with the rest of the form), so my preference is actually to mark the field so that the user knows which field needs to be corrected, and have the validation script not report a validation error back to the field: event.rc = true In that case, the previous value of the field is restored, and the user has to enter the data again. When you play around with the function, you’ll notice that the validation function is only called when the focus leaves the field, so you have to click outside of the field to actually make that error message pop up. In the latter case, we set rc to false, and also display an error message. The member ‘rc’ (or return code) is used to communicate back if the validation was successful or not.
![how to strikethrough text in adobe acrobat pro how to strikethrough text in adobe acrobat pro](https://i.ytimg.com/vi/coyaOES-GTo/maxresdefault.jpg)
HOW TO STRIKETHROUGH TEXT IN ADOBE ACROBAT PRO CODE
This script also includes a check for an empty string, so that the user can wipe out a wrong string and start from scratch.Īs I mentioned before, information is passed to the validation function in the event object, and in the code we see that the member ‘value’ is used to communicate the current value of the field. If (event.value != "" & event.value != "AAAA" & event.value != "BBBB")Īpp.alert("The entered value needs to be either 'AAAA' or 'BBBB'!") To make things easier to copy&paste, here is the script again: event.rc = true