0
0

More than 1 year has passed since last update.

JavascriptからActionTextに値を設定/取得する方法

Posted at

概要

モーダルで入力させてその内容を書き戻すことをしたくて、jsを使用して値の設定/取得をおこなったのでその備忘録です。

コード

jsでActionTextに初期値を設定する
$('trix-editor').val(rich_text.body);

jsでActionTextから入力値を取得する
$modal_fields.find('trix-editor').text()
タグ含めて取得できないので↓の方が良い(contentはActionTextで表示するフィールド名)
$modal_fields.find('input[name="content"]').val()

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0