I am having "Uncaught SyntaxError: missing ) after argument list" at the end of this line. Wondering what was the issue as I’ve checked the parentheses correctly.
<input type="button" class="btn btn-primary" id="btnInsert" value="Save" onclick="insertupdatedata('0',$('#txtCheckpoint').val(),$('#txtCheckpointDisplay).val(),'INSERT')" />
2
Answers
The "SyntaxError: missing ) after argument list" occurs when we make a syntax error when calling a function, e.g. forget to separate its arguments with a comma. To solve the error make sure to correct any syntax errors in the arguments list of the function invocation.
You omitted a single quote
'
for thetxtCheckpointDisplay
jQuery selector.So it should be
And as a side note, you’d better not to use the inline functions like onclick. Try to use
addEventListener('click', function(){})
or something like that for better practice. More about it, visit Why inline JavaScript is bad?Hope it helps!