0
正在使用此模態彈出代碼http://www.queness.com/post/77/simple-jquery-modal-window-tutorial並使用「簡單模態窗口」鏈接。在模態彈出窗口中顯示Textarea文本
如果該頁面上有一個textarea框。我將如何顯示模態窗口上的文本?
該代碼正在php網站上使用。
正在使用此模態彈出代碼http://www.queness.com/post/77/simple-jquery-modal-window-tutorial並使用「簡單模態窗口」鏈接。在模態彈出窗口中顯示Textarea文本
如果該頁面上有一個textarea框。我將如何顯示模態窗口上的文本?
該代碼正在php網站上使用。
這是未經測試的,但你可以做的是添加一些代碼到模態的點擊功能來抓取textarea的文本,然後傳遞給模態本身。這將是這樣的,假設你有一個名爲myTextArea
textarea的:
$('a[name=modal]').click(function(e) {
//Cancel the link behavior
e.preventDefault();
//This is the added part:
//Get the textarea's text
var taText = $('textarea#myTextArea').val();
//Example - Now add the text to a span tag inside the modal
("#myDiv span").text(taText);
...
這應該有希望做到這一點。