feat: Developed markFieldAsRequired and isFieldRequired methods to mark and validate required form fields; added user alert if location information is not provided.
This commit is contained in:
@@ -106,6 +106,8 @@
|
||||
readOnly: isMobile()
|
||||
})
|
||||
|
||||
this.markFieldAsRequired(formFieldCity);
|
||||
|
||||
/**
|
||||
* Date, post code and place label part
|
||||
*/
|
||||
@@ -162,7 +164,7 @@
|
||||
annotationIds: PSPDFKit.Immutable.List([annotation_city_label.id]),
|
||||
value: "Ort",
|
||||
readOnly: true
|
||||
})
|
||||
})
|
||||
|
||||
return [annotation, formField, annotation_date, formFieldDate, annotation_city, formFieldCity, annotation_date_label, formFieldDateLabel, annotation_city_label, formFieldCityLabel]
|
||||
}
|
||||
@@ -304,4 +306,14 @@
|
||||
static inchToPoint(inch) {
|
||||
return inch * 72
|
||||
}
|
||||
}
|
||||
|
||||
static #requiredFieldNames = new Array()
|
||||
|
||||
static markFieldAsRequired(formField) {
|
||||
this.#requiredFieldNames.push(formField.name)
|
||||
}
|
||||
|
||||
static isFieldRequired(formField) {
|
||||
return this.#requiredFieldNames.includes(formField.name)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user