1
我是MooTools的新手,並嘗試向表單內容發送帶有Ajax請求的url。Mootools的發佈請求
<form method="post" enctype="multipart/form-data" action="<?= $PHP_SELF; ?>" name="fn" id="fn">
<input name="user_name" id="user_name">
<input name="user_mail" id="user_name">
<input name="user_text" id="user_name">
<input type="file" name="attach">
<input id="button" type="button" value="Submit">
</form>
<script type="text/javascript">
$('button').addEvent('click', function(event) {
var req = new Request({
method: 'post',
url: 'url.php',
onSuccess: function(response) {
alert(response);
});
});
</script>
當我點擊按鈕,沒有任何反應。如何從表單傳輸數據?
優秀作品。如何最好地從整個表單傳輸數據? – serezha93 2014-09-06 12:16:40
@gladooo,那麼你可以[檢查這個答案](http://stackoverflow.com/questions/2166042/how-to-convert-form-data-to-object-using-mootools)。稍後我會在稍後更新。 – Sergio 2014-09-06 15:27:29