Custom validation script with alert, need help resolving an issue when clearing the form
I have a custom validation script on one of my text fields (WorkDate) which alerts the user to enter their name first from the drop down list (Employee Name) if it hasn't been filled in.
Is there a way to add an alert by just letting them know to enter their name if not filled in but not forcing the user to enter their name first?
The reason I ask is there is an issue on my form when clicking on the Clear Form button. The way it is now is when the clear form is pressed it clears everything except the Work Date with the script in it and the alert pops up to enter the name first. So, the name needs to be added again, delete the Work Date and then clear the form. It's not very user friendly right now 😞
This is the script I have in the WorkDate text field...
if (this.getField("Employee Name").valueAsString==this.getField("Employee Name").defaultValue) { app.alert("Error! You must first select your name.") event.rc = false; } |
