Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Thursday, November 20, 2008 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
Samples and other shared info.

Subject: Using Checkboxes in Lists

You are not authorized to post a reply.   
Page 2 of 2 << < 12
Author Messages
DavidWSnow
Cruiserweight
Posts:127

12/06/2006 6:20 PM Alert 
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
Middleweight
Posts:53

12/08/2006 10:35 AM Alert 
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
Featherweight
Posts:10

12/08/2006 4:49 PM Alert 
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
Middleweight
Posts:53

12/10/2006 9:50 AM Alert 
Flame,

was this answer to me?
Raynell
Middleweight
Posts:53

12/10/2006 9:56 AM Alert 
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
Lightweight
Posts:21

03/18/2008 8:57 PM Alert 
Hi David,

Did you get the checkboxes working?

I've got the same issue you had.

Any help would be welcome.

Thanx

Anton
DavidWSnow
Cruiserweight
Posts:127

03/18/2008 10:04 PM Alert 
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
Lightweight
Posts:21

03/19/2008 12:13 AM Alert 
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
Cruiserweight
Posts:107

03/19/2008 11:43 AM Alert 
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
Cruiserweight
Posts:127

03/19/2008 11:52 AM Alert 
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
Cruiserweight
Posts:107

03/19/2008 12:22 PM Alert 
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
Cruiserweight
Posts:107

03/19/2008 12:24 PM Alert 
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
You are not authorized to post a reply.
Page 2 of 2 << < 12




ActiveForums 3.6
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation