• Resolved rosalitoudtohan

    (@rosalitoudtohan)


    Is it possible to convert the <input type=”submit”> of the Ninjaforms Submit button to a <button> element instead? How to achieve this?

Viewing 1 replies (of 1 total)
  • Shaylee

    (@shayleehansen30)

    Ninja Forms doesn’t provide a native option to change the <input type=”submit”> element of the submit button into a <button> element directly through its interface. However, if you are comfortable with custom coding, there is a way to achieve this with some custom JavaScript and CSS.

    Here’s an example script that you could use:

    jQuery(document).ready(function($) {
        $(document).on('nfFormReady', function(e, layoutView) {
            $('input[type="submit"]').each(function() {
                var newButton = $('<button></button>')
                    .attr('type', 'submit')
                    .attr('id', $(this).attr('id'))
                    .attr('class', $(this).attr('class'))
                    .html($(this).val());
    
                $(this).replaceWith(newButton);
            });
        });
    });
    
    
Viewing 1 replies (of 1 total)
  • The topic ‘Use instead of’ is closed to new replies.