Reputation: 574
Hello everyone i am trying to set key value for input type jquery but i am getting this function.upload.js?v=1.x:26 Uncaught SyntaxError: missing ) after argument list really tried everything but could not find the solution
form.append('<input type="hidden" name="policy" value="'s3Policy['inputs']['policy']'" />');
here s3Policy['inputs'] is an array. please help me solving this error. Sorry for asking such a basic question.
Upvotes: 0
Views: 230
Reputation: 132
You missed the concatenation from your value attribute
Here is the solution:
form.append('<input type="hidden" name="policy" value="'+ s3Policy['inputs']['policy'] +'" />');
Upvotes: 2
Reputation: 7013
try this with the right unwrap
form.append('<input type="hidden" name="policy" value="' + s3Policy["inputs"]["policy"] + '" />');
// here ^^^^^^ and here ^^^^^^
Upvotes: 2