0

I am trying to post comment using the comment form but it says:

Error: Please fill the required fields (name, email).

what should I do, please? here is my code:

'author' =>
                '<div class="row padding-xs-top">
                <div class="col-md-4 col-sm-4">
                    <div class="form-group ct-form-group-label--float"><label for="contact_name">' . '</label> <span class="required"></span><input id="contact_name" name="field[]" class="form-control input-lg" type="text" value="Name *"' . esc_attr( $commenter['comment_author'] ) . '" required="required" /></div></div>',
                
            'email' =>
                '<div class="col-md-4 col-sm-4">
                <div class="form-group ct-form-group-label--float"><label for="contact_email">' . '</label> <span class="required"></span><input id="contact_email" name="field[]" class="form-control input-lg" type="email" value="Email *"' . esc_attr(  $commenter['comment_author_email'] ) . '" required="required" /></div></div>'

1 Answer 1

1

Incorrect field names

'author' =>
                '<div class="row padding-xs-top">
                <div class="col-md-4 col-sm-4">
                    <div class="form-group ct-form-group-label--float"><label for="contact_name">' . '</label> <span class="required"></span><input id="contact_name" name="author" class="form-control input-lg" type="text" value="Name *"' . esc_attr( $commenter['comment_author'] ) . '" required="required" /></div></div>',
                
            'email' =>
                '<div class="col-md-4 col-sm-4">
                <div class="form-group ct-form-group-label--float"><label for="contact_email">' . '</label> <span class="required"></span><input id="contact_email" name="email" class="form-control input-lg" type="email" value="Email *"' . esc_attr(  $commenter['comment_author_email'] ) . '" required="required" /></div></div>'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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