| | |
filling variable with array from vb code.
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2006
Posts: 2
Reputation:
Solved Threads: 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> '
<% 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
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> '
<% 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
•
•
Join Date: Mar 2006
Posts: 2
Reputation:
Solved Threads: 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> </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> </li>'
Thx
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> </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> </li>'
Thx
![]() |
Similar Threads
- Variable passed to each() is not an array (PHP)
- Print the parallel array index with the largest value? (C++)
- HELP dynamically created and resized arrays (C)
- What relation does **indirection operator have with Multidimensional Arrays (C++)
- Array/String intersect and Array/Array intersect code (C#)
- Problem in Reading Array Variable (C)
- Using a variable as an array's index? (C)
- Array declaration problem (C++)
Other Threads in the HTML and CSS Forum
- Previous Thread: resizing a frameset
- Next Thread: Incorporating Excel Spreadsheets
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7





