Display dynamic data to next field’s label in Fluent Form

JavaScript

 jQuery(document).ready(function($){
    if( $('form').hasClass( 'fluent_form_14' ) ) {
        var firstName = $('input[name="user_name[first_name]"]');
        firstName.on('keyup', function(e){
            if ( e.which == 13 ) {
                e.preventDefault();
            }
            
            if( firstName.val() === "" || firstName.val() == typeof undefined )
                $('.dyn-username').html( 'First Name' );
            else
                $('.dyn-username').html( firstName.val() );
        });
    }
});
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.