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

Passing data

Status
Not open for further replies.

kjohnson530

IS-IT--Management
Mar 26, 2006
28
US
Hello all I hope someone can help me resolve a little issue I'm having.

I have created a webpage that displays certain information from a SQL database using a repeat region (using dreamweaver.) My users want to update this "list" (meaning multiple records at same time.)

So I decided to add a select box for the updatable field. I gave it a dynamic name using a loop. to see what I believe to be the relevant code below:
Code:
<select name=""" icount & ".cent" value="<%=(rs1.Fields.Item("CentSecID").Value)%>">


 rs1.MoveNext()
  icount = icount + 1
Wend

response.write"<input name=""count"" type=""hidden"" value=" & icount -1 & ">"
%>

I then direct the page to an update page using a submit button.

On the update page I pull the hidden field value using request.form. I'm using this as a loop variable to determine how many objects were on the other page and to get their names so that their values can be written to the page.

Code:
<%
dim varcount
varcount = (request.form("count"))

dim z

do until varcount = 0
z = (varcount & ".cent")

response.write(request.form(z))

varcount = varcount - 1
loop
%>

My problem is this. If i do a response.write(z) it will display the name of the dynamic fields I have created on the other page. My problem is that my page will not display the contents of the dynamic pulldowns, it simply comes up blank.

Once I pull this information properly I will then be looking to pull two other fields (one being a primary key for my db) so that I can update all the necessary info to my db.

Can anyone offer any reasons why this isn't working? If anyone has a better way I certainly wouldn't mind that input as well.

thanks,
 
Try
Code:
response.write(eval(z))
 
[1] I think you don't mean to set each value to a select (-one or -multiple) element like that. Maybe you mean to set it to each "option" to one select-multiple (multiple meaning user can select multiple options and pass back to the server in a collection).

[2] But then you don't need to "dynamically" set the "name" attribute of the select tag line (option tag takes no name, but value). As there is only one select element line, the name does not need to be dynamic.

[3] Taking into account of these, there are quite a bit of rewriting...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top