Default values for cloned fields

Support General Default values for cloned fields

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4028
    digitaalitoimistodigitaalitoimisto
    Participant

    Hi,

    could you please allow to have default values for cloned fields? Now it seems cloned fields are always reset to blank (unchecked).

    If not possible, could you add easily accessible javascript trigger so that I could implement my own script to prefill cloned fields.

    Thanks!

    #4035
    Anh TranAnh Tran
    Keymaster

    You can set default values for cloned fields by assigning an array of values to std parameter.

    Assuming you have a cloned text field phones which store phone numbers. You can set default value like this:

    
    $default = array(
        '0123-456-789',
        '001-002-003',
    );
    
    // Then in your field
    array(
        'name'  => 'Phone numbers',
        'id'    => 'phones',
        'type'  => 'text',
        'clone' => true,
        'std'   => $default,
    )
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Default values for cloned fields’ is closed to new replies.