Syntax error, missing right parenthesis.. help

Discussion in 'Javascript' started by Phil Powell, Jun 14, 2006.

  1. Phil Powell

    Phil Powell Guest

    <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
     
    Phil Powell, Jun 14, 2006
    #1
    1. Advertisements

  2. Phil Powell

    Randy Webb Guest

    Phil Powell said the following on 6/14/2006 4:55 PM:
    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 Webb, Jun 15, 2006
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.