このjQueryのフォームのプラグインを使用してフォームを送信する方法で、簡単な例とhtml形式を使用してデータを取り出す HTMLコードJquery Ajax Form PluginとPHPを使用してフォームを送信しますか?
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
// prepare the form when the DOM is ready
$(document).ready(function() {
// bind form using ajaxForm
$('#htmlForm').ajaxForm({
// target identifies the element(s) to update with the server response
target: '#htmlExampleTarget',
// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new content
success: function() {
$('#htmlExampleTarget').fadeIn('slow');
}
});
});
</script>
</head>
<body>
<form id="htmlForm" action="post.php" method="post">
Message: <input type="text" name="message" value="Hello HTML" />
<input type="submit" value="Echo as HTML" />
</form>
<div id="htmlExampleTarget"></div>
</body>
</html>
PHPコード
これはちょうど私がする必要がどのような細かい 仕事私が必要な場合はどうすれば知っているフォームフィールドをシリアライズJS関数を介してこのオプションを渡す方法 また、私はフォームが処理されている間に読み込みメッセージを表示したい どうすればいいのですか? thaあなたは
機能(){ $( "#htmlExampleTarget")HTML( '読み込んでいます...'); \t \t}、 – Kamal