Print Page | Close Window

Request.Form confusion

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=18584
Printed Date: 29 March 2026 at 4:18pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Request.Form confusion
Posted By: PrivateEye
Subject: Request.Form confusion
Date Posted: 03 March 2006 at 4:55pm
I am displaying some radio buttons dynamically on ASP page as follows:

EmployeeID = 1
<input type="radio" name="attendance1" value="P"><br>
<input type="radio" name="attendance1" value="A"><br>
<input type="radio" name="attendance1" value="L"><br>

EmployeeID = 2
<input type="radio" name="attendance2" value="P"><br>
<input type="radio" name="attendance2" value="A"><br>
<input type="radio" name="attendance2" value="L"><br>

EmployeeID = 3
...
...

Value attribute have meanings P=Present, A=Absent, L=on leave

I need to read in their values in frmSubmit.asp page. How can I code to get values of all the employee correctly. Please help.


-------------
The Judgement Day



Replies:
Posted By: Scotty32
Date Posted: 03 March 2006 at 5:43pm
you can only get the employee whos been selected by doing

strAttendance1 = Request.Form("attendance1")
strAttendance2 = Request.Form("attendance2")
strAttendance3 = Request.Form("attendance3")


you'll need to add
<form method="post">


or

strAttendance1 = Request.QueryString("attendance1")
strAttendance2 = Request.QueryString("attendance2")
strAttendance3 = Request.QueryString("attendance3")


for

<form method="get">




-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: PrivateEye
Date Posted: 03 March 2006 at 5:51pm
You took it wrong. I know that I can only get the employee who has been selected. I also know the HTML form element and its method. But I want to read the value of selected radio button of each employee that has been created dynamically, through loop. Please help.

-------------
The Judgement Day


Posted By: Scotty32
Date Posted: 03 March 2006 at 6:44pm
ahhhh

then do

for iLoop = 1 to 10 
    Request.Form("attendance" & iLoop )
next

if the number of employees will change then put a field like

<input type="hidden" name="ecount" value="10">

then do

intEmployeeCount = Request.Form("ecount")

for iLoop = 1 to intEmployeeCount
    Request.Form("attendance" & iLoop )
next


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: michael
Date Posted: 03 March 2006 at 7:31pm
Alternatively you can just loop through the whole form collection

For Each fldName in Request.Form
    Response.Write fldName & ": " & _
    Request.Form(fldName) & "<br />"
Next


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net