Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Simple CheckBox Question

Reply
Thread Tools

Simple CheckBox Question

 
 
MarkVan
Guest
Posts: n/a
 
      03-11-2005
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





 
Reply With Quote
 
 
 
 
Jason Brown [MSFT]
Guest
Posts: n/a
 
      03-11-2005
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" <> wrote in message
news:...
>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
>
>
>
>
>



 
Reply With Quote
 
 
 
 
Hal Rosser
Guest
Posts: n/a
 
      03-12-2005

"MarkVan" <> wrote in message
news:...
> 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)



 
Reply With Quote
 
Bullschmidt
Guest
Posts: n/a
 
      03-15-2005
<<
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASPNET CheckBox and a CheckBox in a TemplateField Jason Huang ASP .Net 0 06-29-2007 12:35 AM
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
disable checkbox list checkbox Vikram ASP .Net 1 01-25-2006 02:59 PM
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked. Joey Pang ASP .Net Datagrid Control 4 06-13-2005 02:29 AM
Text on Checkbox below the checkbox tshad ASP .Net 0 04-14-2005 11:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57