Created
July 11, 2016 16:27
-
-
Save Ravenna/61ab6050e935b129b7816da27cc4a30e to your computer and use it in GitHub Desktop.
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
| $.ajax({ | |
| type: "POST", | |
| url: link, | |
| data: data, | |
| success: function(response){ | |
| console.log('Default Entity Updated'); | |
| }, | |
| error: function(data){ | |
| var errors = data.responseJSON; | |
| var i = 1; | |
| $.each(errors, function(key, value){ | |
| var input = $('input[name='+ key +']'); | |
| if(i === 1){ | |
| input.focus(); | |
| } | |
| input.addClass('error'); | |
| input.parents('.form-group').append('<span class="entity-note">'+ value +'</span>'); | |
| i++; | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment