Syntax error, missing right parenthesis.. help

P

Phil Powell

<input type="submit" name="delete_student" value="Delete Applicant"
onClick="setSubmitVal(this); return
willDeleteApplicant('O'Connor, Kerry B');">

This HTML tag causes Javascript errors in IE 7+ and in Mozilla; seems
to be OK in Firefox 1.0 for Linux.

This is a time-sensitive issue that I can't seem to resolve, could
someone come up with a quickie for me in this case? It seems the
student's name is breaking things in Javascript because their name is
"O'Connor".

Thanx
Phil
 
R

Randy Webb

Phil Powell said the following on 6/14/2006 4:55 PM:
<input type="submit" name="delete_student" value="Delete Applicant"
onClick="setSubmitVal(this); return
willDeleteApplicant('O'Connor, Kerry B');">
This HTML tag causes Javascript errors in IE 7+ and in Mozilla; seems
to be OK in Firefox 1.0 for Linux.

This is a time-sensitive issue that I can't seem to resolve, could
someone come up with a quickie for me in this case? It seems the
student's name is breaking things in Javascript because their name is
"O'Connor".

Escape it then:

"O\'Connor"

But, there is nothing in that code that should cause a syntax error. The
error is in code elsewhere.

And, don't use the onclick of the submit button to do that, use the
onsubmit event handler of the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top