Skip to main content
Inspiring
December 12, 2019
Answered

Required drop down field

  • December 12, 2019
  • 1 reply
  • 2208 views

I could use some help with something I can't find on the forums.  I have a fillable form with a drop down field named 'EmployeeName' and a text field named 'WorkDate' which is formatted to enter a custom date.  I would like to ensure the user selects their name from the drop down list BEFORE they fill out the date in the text field.  Is this even possible?  or have some sort of alert message that pops up if they try entering the date before selecting their name?  Thanks!!  

This topic has been closed for replies.
Correct answer traceyc28668387

That's exactly what I needed!  Thank you so much!!

1 reply

try67
Community Expert
Community Expert
December 12, 2019

Sure, that's possible. You can use this code as the custom validation script of the WorkDate field:

if (this.getField("EmployeeName").valueAsString==this.getField("EmployeeName").defaultValue) {
	app.alert("Error! You must first select your name.")
	event.rc = false;
}
traceyc28668387AuthorCorrect answer
Inspiring
December 13, 2019

That's exactly what I needed!  Thank you so much!!