Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php/advajax] problem z textarea..
b4x
post 2.05.2008, 13:19:37
Post #1





Grupa: Zarejestrowani
Postów: 658
Pomógł: 95
Dołączył: 20.12.2005
Skąd: N54,35° E18,63° (Gdańsk)

Ostrzeżenie: (0%)
-----


Męczę się z tym już jakiś czas - ale nie wiem co jest...

  1. <div id="content">
  2. <form method="POST" id="add_news" onsubmit="AddNews(); return false;">
  3.  
  4. <div id="addnews">
  5. {$lang.news_title}
  6. <p><input type="text" name="news_title" value="" /></p>
  7. {$lang.tags}
  8. <p><input type="text" name="tags" value="" /></p>
  9.  
  10.  
  11. <textarea style="width: 100%;height:400px;" name="text">
  12.  
  13.  
  14. <input type="hidden" name="login" value="{$login}" />
  15. <input type="hidden" name="date" value="{$date}" />
  16.  
  17. <input type="submit" id="submit" value="{$lang.add_news}" />
  18.  
  19.  
  20. </form>
  21. </div>


  1. <?php
  2. mysql_query('INSERT INTO `news` (`id`, `title`, `date`, `autor`, `content`, `tags`) VALUES (NULL, "'.$_POST['news_title'].'", "'.$_POST['date'].'", "'.$_POST['login'].'", "'.$_POST['text'].'", "'.$_POST['tags'].'")') or die(mysql_error());
  3. ?>


  1. function AddNews() {
  2.  
  3. advAJAX.submit(document.getElementById("add_news"), {
  4. url: url+"what=add_news",
  5. onSuccess : function(obj) { alert(obj.responseText); showNews() },
  6. onError : function(obj) { alert("Error: " + obj.status); }
  7. });
  8.  
  9. }


I problem polega na tym - że za pierwszy razem (1 kliknięciem) `text` jest puste - a jak kliknę drugi raz to wrzuci...


#edit aha a textarea - przez TinyMCE edytowane

Ten post edytował b4x 2.05.2008, 13:39:44


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 18:25