Solved

Passing input to another asp page(array)

Posted on 2000-05-11
5
212 Views
Last Modified: 2008-03-06
I would like to display a list of links from a sql table and have the user be able to click a radio button for Live or not live and then provide a comment on that link.

the issue is I dont want to do just one at a time I would like to list multiple links on one page and be able to comment on the same page.
0
Comment
Question by:ryderjam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Author Comment

by:ryderjam
ID: 2801483
My initial thoughts are that I could load the record number, the link desc into an array and set up new arrays for the radio button and the comment field but then how do I pass that in form method=post where the receiving page would update the records with their correct responses?
0
 

Expert Comment

by:edwardpoon
ID: 2801592
use Session variables to contain the value of the arrays.

e.g.
Dim record_no(10)
Dim link_desc(10)

record_no(1) = 20
record_no(2) = 10
......


link_desc(1) = "Yahoo!"
link_desc(2) = "Experts-Exchange!"
......


Session("record_no") = record_no
Session("link_desc") = link_desc



Then in the others page, when you want to retrieve the array values, you need to:

dim record_no
dim link_desc (note here don't declare it as array)

record_no = Session("record_no")
link_desc = Session("link_desc")

Hope the above helps

0
 

Expert Comment

by:edwardpoon
ID: 2801595
For more information:

You can go to the link here
http://www.asptoday.com/articles/19990820.htm
0
 

Author Comment

by:ryderjam
ID: 2801776
edwardpoon:

Ok maybe thats a better way to ask the question, how do I populate that array with inputs?

Because remeber I will be updating each record with the provided response.
(ie live (yes/no) and the text comment)

for example i can not pass the following because it wont work:

response.write("<form method=post action=page2.asp>"&_

rs("LinkDesc")&"&nbsp;Live <input name=stat(x) type=radio value=1>Yes <input name=stat(x) type=radio value=0>No  <input name=comment(x) type=text size=25>




0
 

Accepted Solution

by:
Keeth earned 50 total points
ID: 2802670
let's say you have 10 sites listed for comments in a page.
you have option boxes (not radio :-0 or if it's radio you put a pair )  to check mark if it's live and for each option boxes you also have a comment line right?..

well ... when you creat the form you will be using different names for all the checkboxes and different names for all the comment text fields so that  you can identify it on the update. better way to use is the id itself as the name.

i would just use the id for the checkbox name and
id + cmt (or something like for comment fields)
also put a hidden form varible that tells how many rows you are outputting in the html file. that way you can use this number to loop on the collection side.

when someone fills in the form and submits it, all the form elements
will be submitted to the form action script. there you start the looping to receive the values of both fields. Here you will start off with the hidden value you passed for "row numbers" to loop it. if you have a value non blank value for checkbox then you get the comment value from the comment field and call another sub that would do the SQL update for you.

if you have a blank result for your  checkbox then it's not selected by the user and you don't have to even grap the comment text (it's upto you if you want to check for some other comments and do different update here).
loop through the counter and process as many times you want to do the update.

Hope it helps.. let me know if you still confused abou my solution.

-Keeth
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
key press alert 2 48
My Do While is Not Producing Anything 15 88
SP result not being displayed 5 69
Can't select treeview node from iframe 2 54
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question