ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Total number of fields (single entry)

April 14, 2011 11:42am

Subscribe [1]
  • #1 / Apr 14, 2011 11:42am

    spotd

    16 posts

    I am using channel entries to store form submissions, as it gives me a lot more freedom this way.

    My question is if there is a way to count the total number of fields?

    Basically i need to create a status bar of how much has been entered (completed) for the entry. So total fields / vs number of fields complete.

    I know i could iterate through every field name and add to a variable (number), and use a global variable for the total number. Just wondered if there is a less manual way of approaching this?

    Any ideas?

    Thanks Mark

  • #2 / Apr 17, 2011 7:16am

    spotd

    16 posts

    Just thought i would post my solution… Is a bit quirky, but it works well.

    I used the custom_fields loop in SafeCracker to do my counting… this in turn made my status bar (how much of the form filled in) - embed code below -

    
    
    

    May be useful for someone.

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases