skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search