我正试图使用评论表单发表评论,但上面写着:
错误:请填写必填字段(姓名、电子邮件)。
请问我该怎么办?这是我的代码:
\'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>\'
最合适的回答,由SO网友:Valerii Vasyliev 整理而成
字段名称不正确
\'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>\'