Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting checkbox value

Tags:

asp-classic

How do you get the value of a checkbox in Classic ASP?

<input style='border:none;' type='checkbox' name='chkEstimated' />
like image 859
user517406 Avatar asked Apr 27 '11 15:04

user517406


2 Answers

Each checkbox should have a value attribute:

<input style='border:none;' type='checkbox' name='chkEstimated' value="1" />

When you:

Request.form("chkEstimated")

You will either get 1 (string), or nothing if it wasn't checked.

like image 93
Tom Gullen Avatar answered Oct 25 '22 02:10

Tom Gullen


If you mean when you post it to the server then it will only be posted if the checkbox is checked.

Request.Form("name-of-checkbox")

You can add a value attribute to your html markup if you would like but it is not necessary.

like image 24
Craig Avatar answered Oct 25 '22 01:10

Craig