wysihtml5対応のtextarea要素に対して、入力としてのみ空白のみの検証を追加する必要があります。テキストボックスのwysihtml5エディタを入力として空白のみを妥当性検査
私はテキストエリアのコンソールにのみスペースを入力する値は次の通りです:
<br>
が動作していない私の検証ルールは次のとおりです。
if (!$.trim(<textarea value>)) { // textarea is empty or contains only white-space toastr.error("You forgot to write your answer body, kindly write some thing in answer box."); return false; }
私はいずれかを取得していません空白のみの入力値を検証するwysihtml5オプション
$('#some-textarea').wysihtml5({ "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true "emphasis": true, //Italics, bold, etc. Default true "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true "html": false, //Button which allows you to edit the generated HTML. Default false "link": true, //Button to insert a link. Default true "image": true, //Button to insert an image. Default true, "color": false //Button to change color of font });
その後、このテキストを検証する方法 – Rhushikesh