Syntax

12 years 9 months ago - 12 years 9 months ago #165901 by popROAR
Syntax was created by popROAR
Hello,
I had trouble getting the text to display only a field
I tried
[cb:userdata field="##" user="#displayedOrMe" /]
[cb:userfield field="##" user="#displayedOrMe" /]
[cb:usertab tab="##" field="##" user="#displayedOrMe" /]
[cb:cb_fieldname user="#displayedOrMe" /]

and user="#Me" /] in place of displayedOrMe ( since i really only want the user to see there own field )
I found it easier to just place the field in its own tab...(hmm, ok)
but now this is a date and it is unformatted so it reads 2011-06-15
I would like to be able to extract the month and day so to render a calendar icon with the css box.

thus far i can use the text box as
<div class="calendar"> 
   <span class="month">July</span>
    <span class="day">31</span>
</div>
and css with
.calendar{
code:some;
}
.calendar.month{
code:some;
}
.calendar.day{
code:some;
}
but I want this to be dynamic with the actual field..

i thought maybe to use the javascript box? but those skills are weak in my set
furthermore the suggested
alert('[username]');
displays username in alertbox as '[username]' w/o the quotes???

Thanks
Andrew

Please Log in to join the conversation.

12 years 9 months ago #165907 by popROAR
Replied by popROAR on topic [SOLVED] Syntax
I got this to work with code in text box
<script>var dateString = "[cb:usertab tab="##" user="#displayedOrMe" /]";
var myDate = new Date(dateString);</script>

<div class="calendar">
<span class="month"><script>document.write(month[myDate.getMonth()]);</script></span>
<span class="day"><script>document.write(myDate.getDate());</script></span>
</div>

I did not realize the code in the javascript box loaded first switched back and forth on the script escaping the double quotes to get the proper value.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.382 seconds