0

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.

1
  • 1
    you can't mix quotes like that, you need to clean up your syntax. or perhaps ask the question in a way that explains what you want, but are not sure how to do. Commented Apr 4, 2017 at 14:34

2 Answers 2

2

try this with the right unwrap

form.append('<input type="hidden" name="policy" value="' + s3Policy["inputs"]["policy"] + '" />');
//                                               here ^^^^^^                 and here ^^^^^^
Sign up to request clarification or add additional context in comments.

1 Comment

happy coding @NiteshMishra
2

You missed the concatenation from your value attribute

Here is the solution:

form.append('<input type="hidden" name="policy" value="'+ s3Policy['inputs']['policy'] +'" />');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.