Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Request.Form confusion
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Request.Form confusion

 Post Reply Post Reply
Author
PrivateEye View Drop Down
Groupie
Groupie
Avatar

Joined: 21 March 2003
Location: United Kingdom
Status: Offline
Points: 168
Post Options Post Options   Thanks (0) Thanks(0)   Quote PrivateEye Quote  Post ReplyReply Direct Link To This Post Topic: Request.Form confusion
    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
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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 - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
PrivateEye View Drop Down
Groupie
Groupie
Avatar

Joined: 21 March 2003
Location: United Kingdom
Status: Offline
Points: 168
Post Options Post Options   Thanks (0) Thanks(0)   Quote PrivateEye Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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 - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.