Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello All, new to couchcms. I'm just trying to display the creation date of clients as repeatables. I'd like it to auto set, and not to be editable. It does not seem to be working, should I be doing something else? Does the CMS already have a function somewhere for this?

Code: Select all
<cms:template title='Client Information'>
    <cms:repeatable name='myclients' label='Client List' >
        <cms:editable name='name' label='Name' type='text' required='1'/>
        <cms:editable name='business' label='Business' type='text' />
        <cms:editable name='email' label='Email' type='text' validator='email'/>
        <cms:editable name='phone' label='Phone' type='text' required='1'/>
        <cms:editable name='address' label='Address' type='text' />
        <cms:editable name='payment' label='Payment' type='checkbox' opt_values='Yes || No' required='1'/>

        <cms:set name='createddate' label='Created_Date' type='datetime'     format='mdy'
    fields_separator=','
    default_time='@current'  validator=''"/>

        <cms:editable name='id' label='Customer_ID (will be generated automatically)' type='text' validator='set_id' >0</cms:editable> 
        <cms:editable name='notes' label='Notes' type='text' />
        <cms:editable name='contract' label='Contract' type='file' required='1'/>
    </cms:repeatable>
</cms:template>
@summerbasehart

At a glance, I see two things, viz.:
1. Date Field, not to be editable (i.e. is why you posted)
2. The description of the editable named "id".

1. Date Field, not to be editable
You should visit the CouchCMS V2.0 Release Notes and jump to the section "Customizing the Form screen" and look for the explanation "<cms:field>" tag. I suppose this should help your cause.

2. The description of the editable named "id".
Your code:
Code: Select all
<cms:editable name='id' label='Customer_ID (will be generated automatically)' type='text' validator='set_id' >0</cms:editable>

shows "Customer_ID (will be generated automatically)", and from that I feel you should take a look at: ADDON: Sequiential Id. This might come in handy and help you generate even more self explanatory Customer_ID. BTW, in the "label" attribute of "<cms:editable>" you do not need to use an "_ (underscore)", unless you need it specifically, even a "space" between the text would be fine.

Hope this points you in the right direction. Please feel free to come back to the forum for clarification or queries.

Regards,
GXCPL (CTR)
Image
where innovation meets technology
I was asking about the date, not the ID, i had the ID working fine and more specific to my needs with the function I was using

I did a CMS:set for the date and set it to @current. I removed the extra ", the format, and the field separator, and moved formatting down to the show instead and that's all I needed. It auto saves correctly now

But thank you.
Ok. I guess I could not understand your requirement and that my suggestion was not helpful for you.
Nevertheless, glad to know that you got it to work.
Regards,
GXCPL (CTR)
Image
where innovation meets technology
4 posts Page 1 of 1