Last active
August 29, 2015 14:15
-
-
Save felipebizz/13858a860e4ff4f8f01a to your computer and use it in GitHub Desktop.
Envio de List Form Jquery para métotdo no Spring MVC
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
var $form = $('<form method="post" action="'+baseUrl+'/dam/asset/multi-selection/metadata/multi/edit">'); | |
//Aqui meus ids estavam armazenados no localStorage, ai só iterei e concatenei nos inputs | |
for (var i in window.localStorage) { | |
if (i.indexOf('_v-') === -1) { | |
continue; | |
} | |
businessFiles[index] = i.replace('_v-', ''); | |
$form.append('<input type="hidden" name = "ids" value="'+businessFiles[index] +'"/>'); | |
} | |
//Adicionando csrf no post | |
$form.append('<input type="hidden" name = "_csrf" value="'+$("meta[name='_csrf']").attr("content")+'"/>'); | |
$form.submit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment