DavidWSnow
 Basic Member Posts:129
 |
| 06 Dec 2006 11:20 PM |
|
And the final answer is: <TR class="DataGrid_Item"><TD>On Lists:</TD> <TD> Dotti <input name="fldIsOnDList" type="checkbox" value="1" {IIF,"'[IsOnDList]'='True'","CHECKED",""} {IIF,"'[IsOnDList]'='1'","checked",""} /> </TD></TR>
The first IFF checks the box on input and the 2'nd makes it work when updating the record, otherwise the SQL update is trying to stuff an "on" into the bit field. Now it stuffs a "1"
Thanks for your help - dave |
|
|
|
|
Raynell
 New Member Posts:53
 |
| 08 Dec 2006 03:35 PM |
|
hmmm...will this work if you have a list like my original request: I have a table with many values that can be chosen and the user can select as many as applies. how can i check them all to see which ones have been selected by the user when I get, for example, their list of favorites? is this the way to go?
Thanks, Ray |
|
|
|
|
flame
 New Member Posts:10
 |
| 08 Dec 2006 09:49 PM |
|
Hi,
Just an FYI. I had the same situation and solved it a litte bit differently with the following. I didn't set the value in the formatting like so:
<input name="fldIsOnDList" type="checkbox" {IIF,"'[IsOnDList]'='True'","CHECKED",""} />
In my update qry I set it to update as follows:
[IsOnDList] = {IIF,"'@IsOnDList'='on'","1","0"}
I can check and uncheck the field and it now stores properly in the database.
Hope this helps others as it took me quite a while to figure it out as well....
Cheers |
|
|
|
|
Raynell
 New Member Posts:53
 |
| 10 Dec 2006 02:50 PM |
|
Flame, was this answer to me? |
|
|
|
|
Raynell
 New Member Posts:53
 |
| 10 Dec 2006 02:56 PM |
|
Hi,
Let me re state my problem:
1) I have a table of cagegories in which a user my choose on or more of the items for their settings which will be stored in a settings table.
2) upon the request to edit the settings, the settings are retrieved from the table and displayed (somehow).
My problem is how do I get the stored values to be checked upon retrival when I have different values for each item in the settings table?
kind regards, Ray |
|
|
|
|
aterblanche
 New Member Posts:21
 |
| 19 Mar 2008 01:57 AM |
|
Hi David, Did you get the checkboxes working? I've got the same issue you had. Any help would be welcome. Thanx Anton |
|
|
|
|
DavidWSnow
 Basic Member Posts:129
 |
| 19 Mar 2008 03:04 AM |
|
Here is the code I use: Space around < and > to keep Active Forum from eating the code. < td colspan="1" >< input name="fldMH" type="checkbox" value="1" {IIF,"'[MH]'='True'","CHECKED",""} {IIF,"'[MH]'='1'","checked",""} / > Mental Health < /td > As I recall You need the {IIF,"'[MH]'='True'","CHECKED",""} for SQL Server 2000 and the {IIF,"'[MH]'='1'","checked",""} fro SQL 2005. If you want the XML for a complex form with several types of fields I'll email it. /DaveS |
|
|
|
|
aterblanche
 New Member Posts:21
 |
| 19 Mar 2008 05:13 AM |
|
Hi Dave,
I still can't get it to post/send an unchecked value. if the box is checked, it works well. When the checkbox is unchecked, it has no value, nothing, just a viod.
I've added a 0 in the If empty field of the variable. no luck.
I'll be replacing the check box with two radio buttons until I can get it working.
Thanx for the advice Anton |
|
|
|
|
svedire
 Basic Member Posts:128
 |
| 19 Mar 2008 04:43 PM |
|
Hi,
I think when you do an update you should checking whether the form variable for the checkbox is either 'on' or 'off'. In your case, for example: you could use this in your update statement {IIF,"'[fldIsOnDList,Form]'='on'","'True'","'False'"}
Hope this helps...
Sindura |
|
|
|
|
DavidWSnow
 Basic Member Posts:129
 |
| 19 Mar 2008 04:52 PM |
|
For you Sandra's post may be correct. I only want the search done when the box is checked. In the variables on the grid I have: Form variable - fltMH Target - @MH_Filter Target left - MH = ' Target right - ' Empty Target - 1=1 And in the where part of the query - @MH_Filter This search is done with ajax not a post. /DaveS |
|
|
|
|
svedire
 Basic Member Posts:128
 |
| 19 Mar 2008 05:22 PM |
|
Hi,
I think doing it in the following way solves your problem. In the update statement you could do for something like this: Corresponding FieldName: {IIF,"'[fldIsOnDList,Form]'='on'","'True'","'False'"}
Hope this helps.
Sindura
|
|
|
|
|
svedire
 Basic Member Posts:128
 |
| 19 Mar 2008 05:24 PM |
|
Hi, I think doing it in the following way solves your problem. In the update statement you could do for something like this: Corresponding FieldName: {IIF,"'[fldIsOnDList,Form]'='on'","'True'","'False'"} Hope this helps. Sindura |
|
|
|
|