Title: Request: Submit using button instead of input?
Last modified: August 30, 2016

---

# Request: Submit using button instead of input?

 *  [geertvanderheide](https://wordpress.org/support/users/geertvanderheide/)
 * (@geertvanderheide)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/request-submit-using-button-instead-of-input/)
 * I love this plugin and I’ve been using it for years on many projects. I have 
   one request though:
 * The submit button is outputted as an input element with “submit” as its type.
   While this is all well and good for most purposes, input elements cannot have
   generated content (:before and :after), which limits the styling possibilities.
   A button element on the other hand can have generated content attached to it.
   Beyond that, the two elements act the same: they both submit the form and they
   also look the same without styling.
 * Unfortunately, there seems to be no way to change the html tag of the submit 
   button without editing the plugin files directly. So, what do you think of the
   idea of changing the tag to “button” instead of “input”?
 * The code changes required would be something like this:
 *     ```
       function wpcf7_submit_shortcode_handler( $tag ) {
       	$tag = new WPCF7_Shortcode( $tag );
   
       	$class = wpcf7_form_controls_class( $tag->type );
   
       	$atts = array();
   
       	$atts['class'] = $tag->get_class_option( $class );
       	$atts['id'] = $tag->get_id_option();
       	$atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
   
       	$value = isset( $tag->values[0] ) ? $tag->values[0] : '';
   
       	if ( empty( $value ) )
       		$value = __( 'Send', 'contact-form-7' );
   
       	$atts['type'] = 'submit';
       	// Next line commented out
       	// $atts['value'] = $value;
   
       	$atts = wpcf7_format_atts( $atts );
   
       	// Next line is changed
       	$html = sprintf( '<button %1$s>%2$s</button>', $atts, $value );
   
       	return $html;
       }
       ```
   
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

The topic ‘Request: Submit using button instead of input?’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [input](https://wordpress.org/support/topic-tag/input/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)

 * 0 replies
 * 1 participant
 * Last reply from: [geertvanderheide](https://wordpress.org/support/users/geertvanderheide/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/request-submit-using-button-instead-of-input/)
 * Status: not resolved