• Hello, it is possible to set up placeholders for all the forms in TML? And hide the labels and use only the placeholders.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    This should do it, though untested.

    
    function convert_tml_labels_to_placeholders() {
        foreach ( tml_get_forms() as $form ) {
            foreach ( $form->get_fields() as $field ) {
                if ( in_array( $field->get_type(), array( 'text', 'email' ) ) ) {
                    $field->add_attribute( 'placeholder', $field->get_label() );
                    $field->set_label( '' );
                }
            }
        }
    }
    add_action( 'init', 'convert_tml_labels_to_placeholders' );
    
    Thread Starter hcmendez

    (@hcmendez)

    Hello, I tried this code and got an error. I’m using Advance Scripts with Oxygen Builder.

    View post on imgur.com

    View post on imgur.com

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Label as placeholder’ is closed to new replies.