0

Hello everyone,

I have the following script:

var text;
<% For i As Integer = 0 To array.GetLength(0) - 1 %>
text += '<a href="#" onclick="Test("<%= array(i, 3)%>"); return false;" ><%= array(i, 1) %></a>&nbsp;'
<% Next %>

<%= array(i, 1) %> is a name of a person
<%= array(i, 3)%> is a unique key(that contains letters and numbers!)

With this I want to fill up a variable that I display on the screen. When one of the names is chosen I want that the function Test is executed.
But I get a syntax error when the variable is filled. I think it has something to do with : onclick="Test("<%= array(i, 3)%>") but I don't know what's the problem.

Can anyone help me?

VV

1
Contributor
1
Reply
2
Views
11 Years
Discussion Span
Last Post by vvvv
0

Hi,

Tried a couple of other things:
When I do the following there is no problem:
text+= '<a href="#" onclick="Test(1); return false;"><%= array(i, 1) %></a>&nbsp;</li>'
When i add a letter i get the error that ')' is expected.
text+= '<a href="#" onclick="Test(1a); return false;"><%= array(i, 1) %></a>&nbsp;</li>'

Thx

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.