Hi Experts.
I need to compare two dates in an Adobe Form based on the value of a Date Field within the form.
Within the same Subform there is a Date Field (AEDAT) and a Text Field (COMPNAME).
If the date displayed in the date field is after 12th December 2023, the text in the Text Field should be displayed without any changes (as passed from the interface).
If the date displayed in the date field is on or before 12th December 2023, a section of the text displayed in the Text Field should be removed accordingly.
Current JavaScript code is given below (scripted in the initialization of the Subform).
const lv_date_1 = new Date("2023-12-31");
const lv_date_2 = new Date(AEDAT.rawValue);
if(lv_date_2 <= lv_date_1){
COMP_NAME.rawValue = COMP_NAME.rawValue.replace(/TestText/g, "");
COMP_NAME.rawValue = COMP_NAME.rawValue.trim();
}
The IF condition does not work since the text is modified regardless of whether the date is before or after 12th December 2023.
Can anyone help me solve my problem please.
Thanks in advance.
Request clarification before answering.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.