ユーザーが[追加]ボタンをクリックした後、テキストエリアにコンテンツを追加しようとしていますが、何も起こりません。足りないものはありますか?
以下は、選択したコンテンツを追加するjqueryコードです。
$(".add").on("click", function(event) {
console.log("clicked");
//lets get our Question Text...
var theQuestion = $("td:first-child", $(this).parent()).text();
//the row is present, let's then make sure that the proper cell gets oru data.
if ($('.activePlusRow').length > 0) {
$('.activePlusRow').next('.textAreaQuestion').val(theQuestion);
$('.activePlusRow').removeClass('activePlusRow');
}
});
$(".plusrow").on("click", function(event) {
//adding a unique class for the purpose of the click.
$(this).addClass('activePlusRow');
});
以下はテキストエリアです。
$('.questionTextArea').each( function() {
var $this = $(this);
var $questionText = $("<textarea class='textAreaQuestion'></textarea>").attr('name',$this.attr('name')+"[]")
.attr('value',$this.val());
});
編集:
アプリケーションを使用して、自分の目で確かめることができます。以下はアプリの使い方です:
- アプリを開いたら、「グリーンプラス」ボタンをクリックします。モーダルウィンドウが表示されます。
- 検索ボックスに「AAA」と入力し、「検索」をクリックします。
- 検索結果が表示されます。ここに問題があります。ユーザーが「追加」ボタンをクリックして「質問」を追加すると、モーダルウィンドウが閉じて、上部のテキストエリアに「質問」が追加されますが、これは実行されません。