|
|
 |
Re: FN-FORUM: Can I use checkboxes for this functionality?
date posted 15th May 2008 21:46
By any chance are all your check boxes the same name?
I think im right that for check boxes, if they are the same name then
they will combine the values into one key, you must have each with a
separate name
Sam M
Paul Cooper wrote:
> I'm sure this can be done with checkboxes but I'm not sure how. To
> explain what I'm doing here is a grab of the form:
>
> http://www.intexdesign.net/projects/ffs.jpg
>
> It's the middle 'Official / Hands-On' column that's giving me grief.
> When I submit the button below this column and response.write the SQL
> this is what I get:
>
> UPDATE tblCourses SET IsHandsOn = 'on' WHERE ID = 1944;
>
> Fine, except I want to be able to update all the items listed so it should read:
>
> UPDATE tblCourses SET IsHandsOn = 'on' WHERE ID = 1944;
> UPDATE tblCourses SET IsHandsOn = 'off' WHERE ID = 644;
> UPDATE tblCourses SET IsHandsOn = 'off' WHERE ID = 150;
>
> So basically unless the control is on it does not produce the SQL as
> obviously I want users to be able to turn off items so they are not
> 'Hands-On'. To clarify the items can be both 'Hands-On' and
> 'Official' or even neither.
>
> This is my loop when generating the SQL:
>
> -----------------------8
> for each key in Request.Form
>
> If InStr(key, "ISHANDSON") Then
>
> sql = "UPDATE tblCourses SET IsHandsOn = '" & Request.Form(key) & "'
> WHERE ID = " & Mid(key, 10) & ";"
>
> Response.Write sql
>
> End If
>
> 'rsCourseType.Open sql, strConnect, adOpenKeyset, adLockOptimistic, adCmdText
>
> next
>
> -----------------------8
> TIA
> Paul
>
>
|
 |
|