|
|
 |
Re: FN-FORUM: Can I use checkboxes for this functionality?
date posted 16th May 2008 09:59
Change the user interface. If you want all 3 records updated you should
have one checkbox for all three.
When I look at that user interface I certainly get the impression that each
checkbox goes with only the record for that row.
Alternatively, you can have only one checkbox for all 3 rows.
Best is to do this:
All records displayed [ ]
------------------------------------
record 1 blah [ ]
record 2 blah [ ]
record 3 blah [ ]
Now the checkbox at the top of the column can be used to update all records
shown (or you could just add javascript to trigger all boxes below it into a
checked state). At the same time individual checkboxes still only update
the row indicated.
----- Original Message -----
From: "Paul Cooper" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Thursday, May 15, 2008 11:01 PM
Subject: FN-FORUM: Can I use checkboxes for this functionality?
>
> 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
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|