filling variable with array from vb code.

Reply

Join Date: Mar 2006
Posts: 2
Reputation: vvvv is an unknown quantity at this point 
Solved Threads: 0
vvvv vvvv is offline Offline
Newbie Poster

filling variable with array from vb code.

 
0
  #1
Mar 23rd, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 2
Reputation: vvvv is an unknown quantity at this point 
Solved Threads: 0
vvvv vvvv is offline Offline
Newbie Poster

Re: filling variable with array from vb code.

 
0
  #2
Mar 23rd, 2006
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC