Print Page | Close Window

Don't display if another text field is zero

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: [Commercial] Adobe Acrobat
Forum Description: Discussion forum for all versions of Adobe Acrobat and Adobe Reader.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2252
Printed Date: 13 Nov 2018 at 5:37am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Don't display if another text field is zero
Posted By: BrianG
Subject: Don't display if another text field is zero
Date Posted: 20 Nov 2017 at 3:58pm
I have two text fields, Text1 and Text2.  Both are formatted for numbers.  If the value in Text1 is zero, I don't want Text2 to display.  If the value in Text1 is greater than zero, I want Text2 to display.  Is there custom validation script I can use to accomplish this.  Thanks.



Replies:
Posted By: gkaiseril
Date Posted: 20 Nov 2017 at 6:34pm
https://acrobatusers.com/tutorials/show_hide_fields - Hiding and showing form fields using JavaScript by Thom Parker


Posted By: MattB12
Date Posted: 28 Nov 2017 at 11:35pm
To ; gkaiseril
 
This question is off topic but I have followed your posts for quite awhile and you have touched on a subject that I have yet to be able to solve so I am hoping that you can assist. I have a dynamic pdf form created in LC where I have a need to validate if all required fields have data entered in them byway of a button (not a submit button as all I am doing is verifying that all required fields have data entered in them).
 
The type of fields that I have;
Text
Date/Time
Radio Button
Check Box
Drop Down List
Numeric Field
Expanding Table
 
If a button were to be pushed (Ok or Print) and certain required fields were left empty than only those fields should be highlighted along with a message box (app.alert) telling the form user that all required fields have not been filled out. If the button were pushed and all required fields had been completed than a message box should pop up telling them that all required fields have been filled out and they may now proceed by applying a digital signature. Until all required fields are filled out the digital signature box should be either disabled (viewable but cant do anything with it) or hidden and then becomes viewable after successful form validation.
 
There are many hidden objects/subforms which may become visible depending on user selections. When these objects and/or subforms are hidden they should not be considered a required field for this purpose.
 


-------------
Matt B.


Posted By: MattB12
Date Posted: 28 Nov 2017 at 11:54pm
I have tried to piece mail scripts together using what I have learned while creating this form, online forums and a few references.
 
https://help.adobe.com/en_US/livecycle/es/LiveCycle_Designer_Scripting_Basics.pdf - https://help.adobe.com/en_US/livecycle/es/LiveCycle_Designer_Scripting_Basics.pdf
https://helpx.adobe.com/pdf/aem-forms/6-3/scripting-reference.pdf - https://helpx.adobe.com/pdf/aem-forms/6-3/scripting-reference.pdf
 
really hoping that you can help.
R/
Matt


Posted By: gkaiseril
Date Posted: 03 Dec 2017 at 5:35pm
You can use the "On Blur" Action for the field Text1 and based on the value of that field set the "display" property of the Text2 field. Note hiding a field's value will not remove that field from any subsequent calculation using that field.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net