- Total Members: 220,018
- Threads: 525,385
- Posts: 976,987
-
October 25th, 2012, 12:52 AM
#1
Request.Form or Request.QueryString on textbox?
Hi, guys, I have a quick question… I am trying to figure this out, but it’s killing me.
I have a single textbox (generated by ASP)… and what I am trying to do is make the first option onthe textbox, (session variable) display in a “friendly” way.
The textbox name is “Range”
When I change the values, it posts the form to the same page, with the following:
If request.form("Range") = "" Then
Session("Range")=""
Elseif request.form("Range") = "0" Then
Session("Range")="Today"
Elseif request.form("Range") = "1" Then
Session("Range")="Yesterday"
Else
Session("Range")=Session("Range") & " Days"
End If
This textbox actually get the values from a database… so
How can I make this textbox display?
If 0 = display “Today”
If 1 = Display Yesterday
But anything above that display the number PLUS the word days: Example: 7 Days
As soon I post the form again without changing the textbox, it says 7 Days Days, and then if I post again, it says 7 Days Days Days and so on…
If I reset the form, and select the textbox from scratch, it displays correctly, but the second you post it again, keeps adding the word days.
Any ideas?
Thanks
Values: (in order)
Session(“Range”)
Disabled
0
1
7
14
30
60
90
This text box has a onchange=this.form.submit
-
October 25th, 2012, 04:21 AM
#2
If request.form("Range") = "" Then
Session("Range")=""
Elseif request.form("Range") = "0" Then
Session("Range")="Today"
Elseif request.form("Range") = "1" Then
Session("Range")="Yesterday"
Else
Session("Range")=request.form("Range") & " Days"End If
-
October 25th, 2012, 07:08 AM
#3
keep in session only number of days and convert to words after post back
if session("Range")="" then
'do nothing
elseif session("Range")="0" then
response.write "Today"
elseif session("Range")="1" then
response.write "Yesterday"
else
response.wirte session("Range") & " Days"
end if
GK
__________________________________________________ _____
if you found this post is useful click scale

(right side on this reply ) and agree
Similar Threads
-
By richga in forum ASP Development
Replies: 7
Last Post: May 21st, 2007, 05:28 AM
-
By johnpaul in forum ASP Development
Replies: 2
Last Post: November 4th, 2005, 11:42 AM
-
By Calldean in forum ASP Development
Replies: 27
Last Post: April 20th, 2005, 02:50 AM
-
By Feezo in forum ASP Development
Replies: 9
Last Post: March 10th, 2005, 08:14 AM
-
By Steve Schofield in forum ASP Development
Replies: 2
Last Post: January 5th, 2004, 08:44 AM