Created
June 13, 2012 23:08
-
-
Save gmcinnes/2927071 to your computer and use it in GitHub Desktop.
Incomplete Validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function handleOnSubmit() { | |
| var formObject = document.getElementById('discovery-document'); | |
| if (submitted) { | |
| alert('Form has already been submitted. Please wait for a response.'); | |
| return false; | |
| } else { | |
| var errors = false; | |
| var message = 'The form cannot be submitted until the following errors are corrected:n'; | |
| var practiceSelection = document.getElementById('00N50000002PT2j'); | |
| if (practiceSelection.selectedIndex == 0) { | |
| message += 'Sector is a required field.n'; | |
| errors = true; | |
| practiceSelection.focus(); | |
| } | |
| if (errors) { | |
| alert(message); | |
| return false; | |
| } else { | |
| submitted = true; | |
| // alert('Submitting'); formObject.submit(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment