Expected ';'

  • Thread starter throat.wobbler.mangrove
  • Start date
T

throat.wobbler.mangrove

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
 
H

Hywel Jenkins

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'.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top