Do not print field if value is the same
- October 18, 2023
- 1 reply
- 1409 views
Hello everyone,
Maybe someone has a solution for my problem. In a form I have several fields that are defined by the following javascript
The default value is: "Click or tap here to enter text."
the first code action:
Activate field:
if(event.target.value==event.target.defaultValue) event.target.value="";
the second code action:
Deactivate field:
if(event.target.value=="")event.target.value=event.target.defaultValue ;
This means that the placeholder in the field says “Click or tap here to enter text.”. If you click on the field something else can be written. If nothing is changed, the placeholder appears again.
Now I woudl like to have this:
If the field is not filled with new text, i.e. if the default value is not changed, the field should not be printed. It should only be printed when the value changes.
I tried with this expression:
var oFld = this.getField(FieldName);
oFld.display = (oFld.value == oFld.defaultValue)?display.noPrint:display.visible;
but it doesn't work. The field is still printing
Maybe someone has a solution?
Thank you very much
