944,098 Members | Top Members by Rank

Ad:
Mar 23rd, 2006
0

filling variable with array from vb code.

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vvvv is offline Offline
2 posts
since Mar 2006
Mar 23rd, 2006
0

Re: filling variable with array from vb code.

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vvvv is offline Offline
2 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: resizing a frameset
Next Thread in HTML and CSS Forum Timeline: Incorporating Excel Spreadsheets





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC