hej,
chciałem zastosować jHtmlArea - WYSIWYG HTML Editor
wszystko działa jak należy tylko nie wiem w jaki sposób przesłać tekst z textarea na kolejną stronę POST'EM
by móc wysłać go emailem
jest na to jakieś proste rozwiązanie
$text = $('#txtDefaultHtmlArea').htmlarea('toHtmlString') $.post('adres strony',{text: $text},function(dane){$dane = $(dane)});
<form action="/" id="searchForm"> <input type="hidden" name="a" value="1" /> <input type="submit" value="send" /> </form> <script> /* attach a submit handler to the form */ $("#searchForm").submit(function(event) { /* Send the data using post and put the results in a div */ $text = $('#txtDefaultHtmlArea').htmlarea('toHtmlString') $.post('index.php?a=1',{text: $text},function(dane){$dane = $(dane)}); }); </script>
<form action="/" id="searchForm"> <input type="hidden" name="a" value="1" /> <textarea id="txtDefaultHtmlArea" cols="50" rows="15" name="tekst"></textarea> <input type="submit" value="send" /> </form> <script> /* attach a submit handler to the form */ $("#searchForm").submit(function(event) { /* Send the data using post and put the results in a div */ $text = $('#txtDefaultHtmlArea').htmlarea('toHtmlString') $.post('index.php?a=1',{text: $text},function(dane){ $dane = $(dane) $('#wynik').append($dane); }); }); </script> <div id="wynik"> </div>
<script> $(function() { $('#przycisk').click(function(){ $text = $('#txtDefaultHtmlArea'); $.post('index.php?a=1',{text: $text},function(dane){ $dane = $(dane); $('div#wynik').append($dane); }); }); }); </script> <div id="wynik"> </div>
<button id="przycisk">OK</button>