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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed to populate text box

Status
Not open for further replies.

rabisco

MIS
Jan 4, 2007
21
I have struggled with this for a few hours, hoping to get some help from here as usual.

I have created this array...

For x = 0 To rs.fields.count - 1
Response.Write("sampleValues[" & x & "] = '" & rs.fields.item(x).value & "';")
Next

because I need to x values to get the indexes of rs.fields.item(x).value into my asp page for use on the next page.


Further down the page


I have a number listboxes created thus....

For x = 0 To rs.fields.count - 1
Response.Write("<OPTION Value=" & x & ">")
response.write rs.fields.item(x).name
Response.Write("</OPTION>")
Next

All this works perfectly.

In the source of the page, at the top I see the array sampleValues, I see the values and the indexes.

What I want to happen is that for each option seleted in the list box, the text box next to it should be populated with a value from the sampleValues array.

what I have which is not working so far is

<SELECT name="excelFieldName_<%=i%>" onChange="document.frmMap.sampleValue_<%=i%>.value=<%= sampleValues%>[this.options[this.selectedIndex].value]">


so I need to sampleValue_<%=i%> to be populated with the values from the sampleValues array when an option in the excelFieldName_<%=i%> list box is selected.

 
I'm not 100% sure but give this a try:

<SELECT name="excelFieldName_=<%Response.Write i%>" onChange="document.frmMap.sampleValue_=<%Response.Write i%>.value=<%sampleValues%>[this.options[this.selectedIndex].value]">


I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top