0

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')" />
JL_Coder
  • 152
  • 1
  • 4
  • 12

2 Answers2

1

You omitted a single quote ' for the txtCheckpointDisplay jQuery selector.

So it should be

<input type="button" class="btn btn-primary" id="btnInsert" value="Save" onclick="insertupdatedata('0',$('#txtCheckpoint').val(),$('#txtCheckpointDisplay').val(),'INSERT')" />

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!

DreamBold
  • 2,727
  • 1
  • 9
  • 24
-2

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.