Created
November 18, 2017 20:44
-
-
Save drFabio/ad0e0192031abff1ca156b2d2ec5d069 to your computer and use it in GitHub Desktop.
This file contains 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
<p id="feedBack"></p> |
This file contains 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
#feedBack { | |
margin: 0; | |
margin-bottom: 1em; | |
} | |
.hasError { | |
color: #E75854; | |
} | |
.hasSuccess { | |
color: #3BB86C; | |
} |
This file contains 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 clearMessage () { | |
feedBack.innerHTML = '' | |
feedBack.className = '' | |
} | |
function setError (message) { | |
enableButton() | |
var feedBack = document.getElementById('feedBack') | |
feedBack.innerHTML = message | |
feedBack.className = 'hasError' | |
} | |
function setSuccessFeedback (message) { | |
enableButton() | |
var feedBack = document.getElementById('feedBack') | |
feedBack.innerHTML = message | |
feedBack.className = 'hasSuccess' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment