Re: Submitting checkboxes by Ray
Ray
Wed Oct 06 17:01:32 CDT 2004
No, the checkbox, by design, will only pass data when it's checked. One
idea is to use a hidden input that contains your checkbox names, and then
you can loop through those names to determine if the checkbox was checked or
not.
Example:
<form method="post">
<input type="checkbox" name="chk1" value="something">
<input type="checkbox" name="chk2" value="something">
<input type="checkbox" name="chk3" value="something">
<input type="hidden" name="checkboxNames" value="chk1,chk2,chk3">
<input type="submit">
<%
Dim aNames, i
aNames = Split(Request.Form("checkboxNames"), ",")
For i = 0 To UBound(aNames)
Response.Write "<br>"
Response.Write "The checkbox named " & aNames(i) & " was checked: " &
CBool(Request.Form(aNames(i)) <> "")
Next
%>
Ray at work
"jaryr" <najyer@hotmail.com> wrote in message
news:10m8pvaov978vfe@corp.supernews.com...
>I wonder if there is a way to submit all checkboxes (names and values)
> no mater if they are off or on (checked / unchecked). Anybody would know
> some scripts or tricks to get this working.
>
> Thanks,
> John R.
>