I'm rather new in using the datalist-module, but I would like to show two different lists, based on the input from a form, which contains two different checkboxes (among other things) - and the two lists is generated, depending on the selected checkboxes.
But how do I express a SQL-sentence, in order to choose all items with this certain checkbox selected. I guess it's an easy one - if you know what to do - but I hope somebody kan give me a hint about it?
/Lise
Developer forum
E-mail notifications
Datalists - sorted after checkbox input
Lise Trabjerg Pedersen
Posted on 30/04/2012 12:58:33
Replies
Lars Britz
Posted on 30/04/2012 16:07:44
Depending on the check-box value that you have set, you can create a condition in your datalist. If you have set a default-value on the check-box of "1" or "True", which is the most normal setting, you will be able to filter out any rows that do not contain this value.
Example:
http://screencast.com/t/RYfSnQt9FwH
Probably not the best of examples, but in this view I am showing the users with AccessUserID = 1. In the same way, you can choose to view rows that contain "True" or "1". You can also view any rows that do not contain those values by simply changing the operator.
You can also create the view using Sql-statements, in which case you simply follow normal sql-syntax:
http://www.w3schools.com/sql/sql_where.asp
Lise Trabjerg Pedersen
Posted on 01/05/2012 10:38:55
Thank you for your answer, Lars.
In first place, I did almost as you suggests, but since it did'nt work, I thought there was another, more advanced solution for it. :-)
But although I have put 1 as validation value in my checkboxes, no value appears in the list, when I checks them and sends a form, and looks at the input after that.
Is it the wrong place, I'm defining the value - or perhaps an error in the module?? (I have tried in two different solutions - with the same result - no checkbox value)
See attached file, please.
/Lise
In first place, I did almost as you suggests, but since it did'nt work, I thought there was another, more advanced solution for it. :-)
But although I have put 1 as validation value in my checkboxes, no value appears in the list, when I checks them and sends a form, and looks at the input after that.
Is it the wrong place, I'm defining the value - or perhaps an error in the module?? (I have tried in two different solutions - with the same result - no checkbox value)
See attached file, please.
/Lise
Lars Britz
Posted on 03/05/2012 10:57:08
This post has been marked as an answer
It is the wrong place :)
A bit further up, there is an input-field named "Standard værdi". Try inputting the number 1 here instead.
A bit further up, there is an input-field named "Standard værdi". Try inputting the number 1 here instead.
Votes for this answer: 0
You must be logged in to post in the forum