CGI-FormBuilder

 view release on metacpan or  search on metacpan

lib/CGI/FormBuilder.pm  view on Meta::CPAN


    my $jspre  = $self->jsprefix || '';
    my $jsmisc = '';

    my $grow = $self->growname;
    $jsmisc .= <<EOJS;
var ${jspre}counter = new Object;  // for assigning unique ids; keyed by field name
var ${jspre}limit   = new Object;  // for limiting the size of growable fields
function ${jspre}grow (baseID) {
    // inititalize the counter for this ID
    if (isNaN(${jspre}counter[baseID])) ${jspre}counter[baseID] = 1;

    // don't go past the growth limit for this field
    if (${jspre}counter[baseID] >= ${jspre}limit[baseID]) return;

    var base = document.getElementById(baseID + '_' + (${jspre}counter[baseID] - 1));

    // we are inserting after the last field
    insertPoint = base.nextSibling;

    // line break

t/1a-test23.html  view on Meta::CPAN

<script type="text/javascript"><!-- hide from old browsers
var fb_counter = new Object;  // for assigning unique ids; keyed by field name
var fb_limit   = new Object;  // for limiting the size of growable fields
function fb_grow (baseID) {
    // inititalize the counter for this ID
    if (isNaN(fb_counter[baseID])) fb_counter[baseID] = 1;

    // don't go past the growth limit for this field
    if (fb_counter[baseID] >= fb_limit[baseID]) return;

    var base = document.getElementById(baseID + '_' + (fb_counter[baseID] - 1));

    // we are inserting after the last field
    insertPoint = base.nextSibling;

    // line break

t/3a-test23.html  view on Meta::CPAN

<script type="text/javascript"><!-- hide from old browsers
var fb_counter = new Object;  // for assigning unique ids; keyed by field name
var fb_limit   = new Object;  // for limiting the size of growable fields
function fb_grow (baseID) {
    // inititalize the counter for this ID
    if (isNaN(fb_counter[baseID])) fb_counter[baseID] = 1;

    // don't go past the growth limit for this field
    if (fb_counter[baseID] >= fb_limit[baseID]) return;

    var base = document.getElementById(baseID + '_' + (fb_counter[baseID] - 1));

    // we are inserting after the last field
    insertPoint = base.nextSibling;

    // line break



( run in 0.250 second using v1.01-cache-2.11-cpan-4d50c553e7e )