Quick question. I have a text type database field. I have several checkboxes to enter values into it. I want to display the values on a page. By default, {LINKWHATEVERTHISFIELDIS} would display something like:
value1, value2, value3, etc
It puts a comma between the values. How can I change this to something else, like a line-break or something.
If you know all the possible values you could do <IF {LINKCHECKED[field <,> value1]}> value1<br></IF> <IF {LINKCHECKED[field <,> value2]}> value2<br></IF>
but if you don't you can use some PHP: <?php echo str_replace(',' '<br>', '{LINKWHATEVERTHISFIELDIS}'); ?>
I don't really understand what you would replace the field and value with, well actually, the value isn't a problem, but what do I replace the field with and how would it be written? In { } ?
I really need to get the values to display as bullet points.
my link field is {LINKSERVICESLIST}
And my values are...
1 hour lessons 2 hour lessons
So how would it be put into bullet points instead of the commas it outputs as standard?
Comments on checkbox value separator
Forum Regular
Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 91
Total Comments: 305
Hello Paul,
Quick question. I have a text type database field. I have several checkboxes to enter values into it. I want to display the values on a page. By default, {LINKWHATEVERTHISFIELDIS} would display something like:
value1, value2, value3, etc
It puts a comma between the values. How can I change this to something else, like a line-break or something.
Thank You
David
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
If you know all the possible values you could do
<IF {LINKCHECKED[field <,> value1]}> value1<br></IF>
<IF {LINKCHECKED[field <,> value2]}> value2<br></IF>
but if you don't you can use some PHP:
<?php echo str_replace(',' '<br>', '{LINKWHATEVERTHISFIELDIS}'); ?>
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
<?php echo str_replace(',' '<br>', '{LINKWHATEVERTHISFIELDIS}'); ?>
So where would you put this php?
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
<IF {LINKCHECKED[field <,> value1]}> value1<br></IF>
<IF {LINKCHECKED[field <,> value2]}> value2<br></IF>
I don't really understand what you would replace the field and value with, well actually, the value isn't a problem, but what do I replace the field with and how would it be written? In { } ?
I really need to get the values to display as bullet points.
my link field is {LINKSERVICESLIST}
And my values are...
1 hour lessons
2 hour lessons
So how would it be put into bullet points instead of the commas it outputs as standard?
Thanks in advance.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
If your template variable is {LINKSERVICESLIST} that must mean you named your field serviceslist, so
As for placing the PHP, you put it wherever you want it shown in the template.
With bullets instead of line breaks:
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
If I put the PHP version in a template, the page shows as a blank white page.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Do you have error suppression on? Get the debug output. We're talking about 4.0.26 here I presume?
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
Sorry paul, I should have posted, i sorted this problem. Thanks