I'm using a simple PreSaveAction() on my custom Edit Form. This is SharePoint 2013 on-premise. The goal is to validate a drop down menu against a text field. ie. If the Status drop down is set to "Unfilled" then ensure that the "Unfilled reason" text field has some text.
I added a Script Editor Webpart to the page and added the following code:
The alerts are working and showing the correct values, however the Status field which is defaulted to "Pending" (or could be anything previously selected in the drop down) automatically clears to blank - but then saves using the default "Pending" even when it changed to "Unfilled".
Any idea why this is happening or how to prevent it?