469,290 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Simple CheckBox Question

I am pretty new to ASP.

HTML Page
<input type="checkbox" name="chkStat" value="" checked>Low

ASP Page
chkCheck = request.form("chkStat")
response.write chkCheck

I get nothing? How do I pass the value of the checkbox from the HTML page
to ASP page.

Thank you

Jul 22 '05 #1
3 1531
you haven't given it a value. well, you have. an empty string.

if you actually give it a value, it'll pass that.

<input type="checkbox" name="chkStat" value="This Is A Value" checked>
--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no rights.
"MarkVan" <dt*******@yahoo.com> wrote in message
news:OY*************@TK2MSFTNGP10.phx.gbl...
I am pretty new to ASP.

HTML Page
<input type="checkbox" name="chkStat" value="" checked>Low

ASP Page
chkCheck = request.form("chkStat")
response.write chkCheck

I get nothing? How do I pass the value of the checkbox from the HTML page
to ASP page.

Thank you


Jul 22 '05 #2

"MarkVan" <dt*******@yahoo.com> wrote in message
news:OY*************@TK2MSFTNGP10.phx.gbl...
I am pretty new to ASP.

HTML Page
<input type="checkbox" name="chkStat" value="" checked>Low

ASP Page
chkCheck = request.form("chkStat")
response.write chkCheck

I get nothing? How do I pass the value of the checkbox from the HTML page
to ASP page.


Actually you're getting an empty string, which is the "value" you assigned
to the "chkStat" checkbox.
make this change:
<input type="checkbox" name="chkStat" value="Low" checked>Low
_____________________________________^ (new value)

Jul 22 '05 #3
<<
I get nothing? How do I pass the value of the checkbox from the HTML
page to ASP page.


Generally speaking you can pass variables from page to page by:

1) Posting form fields from one page to the next (or to the same page)
and on the page to retrieve the value strLName = Request.Form("LName")

2) Using a querystring such as Response.Redirect
"login.asp?lname=smith&fname=tom" and on the page to retrieve the values
strLName = Request.QueryString("lname") and strFName =
Request.QueryString("fname")

3) Using session variables such as Session("LName") = "Smith" and on the
page to retrieve the value strLName = Session("LName")

4) Using cookie variables such as Cookie("LName") = "Smith" and on the
page to retrieve the value strLName = Cookie("LName")

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by claudel | last post: by
10 posts views Thread by Jennyfer J Barco | last post: by
2 posts views Thread by Allain B√łge | last post: by
34 posts views Thread by clinttoris | last post: by
1 post views Thread by rjoseph | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.