Expected ';'

Discussion in 'Javascript' started by throat.wobbler.mangrove@gmail.com, Oct 24, 2005.

  1. Guest

    Hi,

    I'm trying to use the following javascript in
    an XSLT file:

    <a>
    <xsl:attribute name="href">
    javascript:document.form1.surname.value="Smith";
    </xsl:attribute>
    Send Information
    </a>


    However, when I click the link I get an error " Expected ';' ". I don't
    get this error however if I replace the javascript with
    "form1.submit()" so I know it's definitely something to do with the
    syntax of my line of javascript.

    Things I have tried so far:

    1. Using the js as part of an onclick instead (brings up the same error
    but this time as soon as the page loads)

    2. Removing the "document." before the form name

    3. Actually getting rid of the semi-colon

    4. Using ' instead of " to wrap the value

    5. Using other field names

    I'd be grateful if anyone had any ideas what's wrong, or if indeed I
    really am missing a semi-colon from somewhere?

    Many, many thanks
     
    , Oct 24, 2005
    #1
    1. Advertising

  2. In article <>,
    says...
    > Hi,
    >
    > I'm trying to use the following javascript in
    > an XSLT file:
    >
    > <a>
    > <xsl:attribute name="href">
    > javascript:document.form1.surname.value="Smith";
    > </xsl:attribute>
    > Send Information
    > </a>


    Change "Smith" to 'Smith'.

    --

    Hywel
    http://kibo.org.uk/
     
    Hywel Jenkins, Oct 24, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Tomson
    Replies:
    3
    Views:
    1,506
    Phil Tomson
    Feb 16, 2005
  2. Paul
    Replies:
    0
    Views:
    319
  3. Ammar_ace

    BC30188 Declaration Expected

    Ammar_ace, Jul 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    5,093
    Fraggle
    Aug 21, 2003
  4. Kathy Burke
    Replies:
    2
    Views:
    438
    Kathy Burke
    Aug 1, 2003
  5. gh0st54
    Replies:
    6
    Views:
    8,164
    Natty Gur
    Aug 19, 2003
Loading...

Share This Page