Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing Array value to textbox

Status
Not open for further replies.

AgentM

MIS
Jun 6, 2001
387
US
I am trying to write an Array value to the value field of the textbox.
Here's my code
<input type="text" name="txtlogin_1" id="Txtlogin_1" value ='<%= Arr(0) %>' >

I get a "Type mismatch" error at this line.
Any ideas why? pls let me know.

thank you
 
Dunno what the rest of your code looks like, but try something like this:

arrTest = Split(strTest,",")

for k=0 to ubound(arrTest)


strTable = strTable & "<input type=""text"" name=""whatever"" value=""" & (arrTest(k)) & """>" & vbcrlf

end if

next
 
Yes, it works like that, but not the other way around
My code is like this :-
Arr=Split(strValue,":")
<input type="text" name="txtlogin_1" id="Txtlogin_1" value ='<%= Arr(0) %>' >
<input type="text" name="txtlogin_2" id="Txtlogin_2" value ='<%= Arr(1) %>' >

and so on....

I could not figure out why Arr(0) will not work in a value field?
Seems like it should.
 
got me .. that should work even is strvalue is blank, you'll at least have 1 value even if it's empty with split.

perhaps try double quotes instead of singles?

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top