Skip to content

Instantly share code, notes, and snippets.

@mrofi
Created January 2, 2015 14:18
Show Gist options
  • Save mrofi/1cb60b2e581be5581cf7 to your computer and use it in GitHub Desktop.
Save mrofi/1cb60b2e581be5581cf7 to your computer and use it in GitHub Desktop.
Back To Cage (Reset and Hide the Form)
var backToCage = function() {
e = $('#edit-container');
form = e.find('form');
form[0].reset();
form.find('.alert').addClass('hide');
form.find('.global-error').html('');
form.find('.form-group').removeClass('has-error');
form.find('.error').html('');
form.find('.uploadPreview').attr('src', noImage);
form.find('[name=photo]').val(noImage);
e.appendTo('section.cage');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment