LiveCycle when submit is pressed validation gets performed and then it says that mandatory fields are not filled in.
See the following link:
This way you might have to find how to achieve the appropriate validation before executing the submit function.
Afterwards, you can do some extra script to your liking.
Hope this will help.