Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorIsterling
    • CommentTimeMar 21st 2008
     
    I have a repeatable in my application. Is there anyway to change the name of the section with each additional?
    i.e. the section title is current year. I'd like to have each additional section to say "1st prior" "2nd prior" and so on.
    is this possible?
    • CommentAuthorcedsav
    • CommentTimeMar 27th 2008
     
    The only way to do this is with a custom javascript function. You can try to copy&paste the code below in the form builder custom code field (see also: http://app.formassembly.com/pages/support/customization/).

    <script type="text/javascript">
    wFORMS.behaviors.repeat.onRepeat = function(elem) {
    var m = wFORMS.behaviors.repeat.getMasterSection(elem);
    var i = wFORMS.getBehaviorInstance(m, 'repeat');
    var l = elem.getElementsByTagName('legend');
    var count = i.getSectionsCount();
    switch(count) {
    case 2:
    l[0].innerHTML = "1st prior";
    break;
    case 3:
    l[0].innerHTML = "2nd prior";
    break;
    case 4:
    l[0].innerHTML = "3rd prior";
    break;
    /* add cases as needed */
    }
    }
    </script>