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 (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
GrayHat
post
Post #2





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

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


Kod
this.responseText.getElementById('comment_message')


(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 23.08.2025 - 21:31