Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [mintAjax]odczytanie zmiennej
reyne
post
Post #1





Grupa: Zarejestrowani
Postów: 73
Pomógł: 1
Dołączył: 19.12.2007

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


Witam ponownie,

mam taki kawalek kodu do wysylania komentarzy w ajaxie,



Kod
echo '
<script type="text/javascript">
function SendRequest() {
     var req = mint.Request();

     req.OnSuccess = function() {
         $("response").innerHTML = this.responseText;
     }

     req.SendForm("form");
}
</script>';

Kod
     echo "<form id='form' name='inputform' method='post' action='$clink'>
<table align='center' cellspacing='0' cellpadding='0' class='tbl'>
<tr>
<td align='center'><textarea name='comment_message' rows='6' class='textbox' style='width:400px'></textarea>
</tr>
<tr>
<td align='center'><input type='checkbox' name='disable_smileys' value='1'>".$locale['c107']."


<button  name='post_comment' onclick=\"SendRequest()\" class='button'>".$locale['c102']."</button></td>
</tr>
</table>
</form>\n";

małe pytanie: jak odczytać zawartość wysłanych danych z $_POSTA? wiem ze całość znajduje sie w kodzie
this.responseText ale jak np odwolac sie do pojedynczego elementu? np pola comment_message..

Kod
$("response").innerHTML = this.responseText.comment_message;
nie bardzo dziala winksmiley.jpg
Go to the top of the page
+Quote Post

Posty w temacie
- reyne   [mintAjax]odczytanie zmiennej   20.08.2008, 11:10:27
- - GrayHat   Kodthis.responseText.getElementById('comme...   21.08.2008, 08:06:49


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 Aktualny czas: 19.08.2025 - 09:25