By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,696 Members | 1,424 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,696 IT Pros & Developers. It's quick & easy.

Syntax error, missing right parenthesis.. help

P: n/a
<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

Jun 14 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.