2012-01-03 104 views

回答

0

這是未經測試的,但你可以做的是添加一些代碼到模態的點擊功能來抓取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); 

    ... 

這應該有希望做到這一點。