0
$args = array(
                'id_form'           => 'commentform',
                'class_form'        => 'comment-form theme-comment-action',
                'id_submit'         => 'submit',
                'class_submit'      => 'submit',
                'name_submit'       => 'submit',
                'submit_button'     => '<a name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s"><i class="fa fa-comment" aria-hidden="true"></i><span> Submit Comment </span></a>',
                'title_reply'       => '',
                'title_reply_to'    => __( 'Reply to %s','text-domain' ),
                'cancel_reply_link' => __( 'Cancel comment','text-domain' ),
                'label_submit'      => __( 'Post comment','text-domain' ),
                'format'            => 'xhtml',
                'comment_field'     =>  '<textarea id="comment" name="comment" placeholder="'.__('Enter Your Comment Here','text-domain').'" cols="45" rows="8" aria-required="true">' .'</textarea>',
                'logged_in_as'      => '<p class="logged-in-as">' .
                                      sprintf(
                                          __( 'Logged in as %1$s. <a href="%2$s" title="%3$s">%4$s</a>', 'text-domain'),
                                          $user_identity,
                                          wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ),
                                          __('Log out?','text-domain'),
                                          __('Click to log out.','text-domain')
                                      ) . '</p>',
                'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.','text-domain' ) .'</p>',
                'fields'            => apply_filters( 'comment_form_default_fields', $fields ),
            );

            comment_form( $args );

Above is the method how we make changes to some of the fields in the comment system.

One such field is submit Button →

'submit_button'     => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',

But my HTML is designed in such a way that this uses an <a></a> tag. Itried to use something like this:

<a name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s"><i class="fa fa-comment" aria-hidden="true"></i><span> Submit Comment </span></a>

But it is doesn't work. Can someone recommend any fix?

2

The <a> tag is the wrong tag for a submit button. <input type="submit"> and <button> are designed for this purpose. An <a> tag won't even submit the form data. You need to change your HTML to accommodate this fact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.