Okay
  Public Ticket #973234
Remove fields in contact form
Closed

Comments

  •  5
    lkbirk started the conversation

    Hi there. 

    I really love the design of the contact form and have used it in some places, but I  need a contact form where the only field to fill out is email. 

    Is there some way to code the contact form so it only has 1 field? 

    Thank you. 
    - Stine

  • [deleted] replied

    Hi Stine,

    That is not implemented in our theme, however if you want that please replace this file (one time only):

    Download this file and replace it in this directory (of the theme): /assets/js

    Then, add this JavaScript code in Theme Options > Footer > JavaScript & Tracking Code > Footer JavaScript:

    <script type="text/javascript">
    jQuery( document ).ready( function( $ ) {
        $( '.message-form .form-group input[name="name"]' ).addClass( 'not-required' );
        $( '.message-form .form-group input[name="email"]' ).addClass( 'not-required' );
    } );
    </script>

    And after that, add Custom CSS to hide fields from the screen.