If it is 1, change text to green
How can I make this appear in the items in a table?
columnname:<span color="{fn:colorswitch}">{var:tablename.row.model.field}</span>In switchData source: {var:tablename.row.model.otherfield}
Body:
0:red
1:green
But another question arose.
How can I use the switch to check if there is something written in the database table and get a return?
Ex.
Optional upload of files.
Check if there is any data written in the table and show the link to view the file, if not leave it blank.
Sorry my english hehe
Please detail
One more question regarding the switch in CF.
Database Ex:
db_brand: Ford, Chevrolet
db_cars: Mustang, Fusion, Camaro, Equinox ...
I have two dropdowns, in the first db_brand load, this relates to the second dropdown that loads db_cars.
Everything is working perfectly, to load the second dropdown I do a reload.
My problem is when I use the new function, Allow Additions.
When I type a new car for example, when reloading, the second dropdown goes blank, I would like it to be reloaded along a default value.
How can I do this?
OR you can just use a default in your dropdown. It should look something like this
{var:mybuiltdropdownlist/apples=Apples are my favourite fruit}
This way if the mybuiltdropdownlist is empty, then a value of "apples" with the label "Apples are my favourite fruit" will be supplied instead.
The other option, when reloading the second dropdown, disappears
You know how in a switch you have say
1:Something you want shown if it's 1
0:Something you want shown if it's 0
?
*:Something you want shown if it's anything else
Just make sure that * comes last.
Note: I left as follows
{var: read_data25}
* Apple = Apple
However, if I decide to choose again from the list that I already have in the database (1st dropdown) when reloading the 2nd dropdown, it has the "Apple" option and below the list the reloaded item
1st image - shows when a new item is added (typed).
2nd image - shows when I decide to choose one of the items loaded in the database. In this case, the 2nd drop-down is reloaded and with two options, the second of the list is the option that should be chosen.


that way the correct item is now in 1st in the list
{var: read_data25}
* Apple = AppleThat's not at all what I told you to do.
{var:read_data25} would go in the dropdown options list, the *:Apple=Apple would go in the switch.
