確認ダイアログのテキスト領域に入力されたユーザー テキストを取得しようとしています。どのようにアイデアはありますか?
alert ($('#optionalmessage').text());
しないようです。
$(doument).ready(function () {
$("#click").click(function (event) {
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Send it ": function () {
alert ($('#optionalmessage').text());
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
また、このテキストエリア用にさらにスペースを作成する必要があります(現在フィドルにあるよりも多く)が、
<textarea rows="4" cols="50">
それはほとんど消えます...