0

Below is the html code which i am using

<a onclick="submit_details('143','v
VASANT','PATIL','8275053468','425201');" href="javascript:;">2</a>

Below is the function call its going

function submit_details(pid,fname,lname,phone,zip){
    $("#sp_value").val(pid);
    $("#sf_value").val(fname);
    $("#sl_value").val(lname);
    $("#sph_value").val(phone);
    $("#sz_value").val(zip);
    $("#detail_form").submit();
}

whicle clicking i am getting error Uncaught SyntaxError: Unexpected token ILLEGAL in the error console

user2715615
  • 101
  • 1
  • 9

2 Answers2

2

make it in single line

 <a onclick="submit_details('143','v VASANT','PATIL','8275053468','425201');" href="javascript:;">2</a>
rajesh kakawat
  • 10,826
  • 1
  • 21
  • 40
0

You probably have embedded illegal characters in your code.

see :

Uncaught SyntaxError: Unexpected token ILLEGAL

(i am assuming you formatted your function text to fit well on two lines for the sake of posting, but still...) also, while calling the function, there should not be a newline.It should be

<a onclick="submit_details('143','v VASANT','PATIL','8275053468','425201');" href="javascript:;">2</a>

otherwise it might give different errors (based on where you have entered the newline, like interminated string constant error, in your syntax)

Community
  • 1
  • 1
gaurav5430
  • 12,934
  • 6
  • 54
  • 111