Hi,
I have a form with parts in javascript. I want to use the token protection in my PHPMaker project and not disable "Check token for form post".
I read that I should add: token: EW_TOKEN,
Javascript is not exactly my best area...It does not work for me, probably because I did something wrong...
<script>
$('#upload_btn').on('click', function(){
var fd = $.FileDialog({
id: 'upload_form',
token: EW_TOKEN,
action: './index.php'
});
fd.on('files.bs.filedialog', function(ev) {
$.each(ev.files, function(index, obj){
$('#upload_form').append(
"<input type='hidden' name='names[]' value='" + obj.name + "'>" +
"<input type='hidden' name='contents[]' value='" + obj.content + "'>"
);
});
});
});
</script>
I