Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript - assigning a checkbox value to a variable

Status
Not open for further replies.

neillovell

Programmer
Aug 27, 2002
560
GB
Hi all,
I have a checkbox whose value is that of a number in a database (a simple integer).
The problem is I want to assign this value to a variable for comparison. So I can say if the checkbox is checked, update the record where the unique id matches the value of the checkbox (I have lots of checkboxes each with a number).
But if I do anything other than Dim RecordID (say 'As Integer' or variant or string) the page will not load. Any ideas?

<input type=&quot;Checkbox&quot; name=&quot;EditPostItCheckboxField<%=Counter%>&quot; value='<%= RecSet(&quot;UniqueID&quot;) %>' id=&quot;EditPostIt<%=Counter%>&quot;>

Dim RecordID
RecordID = request.form(&quot;EditPostItCheckboxField1&quot;)
 
When using ASP you cannot define the type i.e. as integer or string so you are correct in just writing
Code:
Dim RecordID
To check it's value try using:
Code:
if request.form(&quot;EditPostItCheckboxField1&quot;)=&quot;on&quot; then RecordID = &quot;checked&quot;
and set RecordID to whatever value you want. Also this question would be more suited to the ASP forum (forum333)


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
RecordID=(Request....)=vbchecked
If You want to know the value for a chackbox press F2 and search for vbchecked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top