最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

comment form name and email not working?

programmeradmin4浏览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>'

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>'

Share Improve this question asked Sep 29, 2020 at 19:29 socialsocial 713 silver badges9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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>'

发布评论

评论列表(0)

  1. 暂无评论