请帮助我修复下面的文本编辑器的形式与条件所需的功能通过JavaScript或任何超文本标记语言的东西。
我正在使用前端的wp编辑器字段上传求职者的简历。但我希望这个字段是必需的(*),所以表单将不会被提交,直到这个表单为空。
$editor_id = 'resume_content';
$editor_css = '
<style>
.wp-editor-container{
border: 1px solid #e5e5e5;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.wp-switch-editor,
.tmce-active .switch-tmce, .html-active .switch-html{
height:25px;
}
</style>';
wp_editor( $default['resume_content'], $editor_id, array( 'editor_class' => 'form-control', 'media_buttons' => false, 'editor_css' => $editor_css, ) );发布于 2016-08-12 13:34:40
请使用。
<?php wp_editor( $listing->post_content, 'listingeditor', $settings = array('textarea_name' => post_content) ); ?>发布于 2016-08-12 13:41:14
您可以使用filter函数:
add_filter("the_editor", "add_required");
function add_required($editor){
$editor = str_replace( '<textarea', '<textarea required="required"', $editor );
return $editor;
}https://stackoverflow.com/questions/38910564
复制相似问题