<form id="myForm"> Введите имя:<br/> <input id="username" type="text" size="20" value=" "><br/> <input type="submit" value="Отправить"> </form> <div id="content"></div> <script> $(document).ready(function(){ $('#myForm').submit(function(){ $.ajax({ type: "POST", url: "/test.php", data: "username="+$("#username").val(), success: function(html){ $("#content").html(html); } }); return false; }); });
<input type="submit" value="Отправить" onclick="document.getElementById('username').value = '';">
<input type="submit" value="Отправить" onclick="this.form.reset(); return true;">
<input type="submit" value="Отправить" onclick="this.form.reset(); return false;">
<input type="submit" value="Отправить" onclick="document.getElementById('myForm').submit(); clean()">
function clean() { document.myForm.username.value=""; }
$('#myForm').submit(function(){ $.ajax({ type: "POST", url: "modules/test/test.class.php",
<script type="text/javascript"> $(document).ready(function() { $("#formID").validationEngine(); $("#formID").ajaxForm({ beforeSubmit: function(){ return $("#formID").validationEngine('validate'); }, success: function(){ $("#formID").animate({ left: 0, opacity: 'toggle'}, 400); $('#normal_player_block').delay(200).animate({ left: 0, opacity: 'show'}, 600).delay(6000).animate({ left: 0, opacity: 'hide'}, 600); $("#formID").delay(6500).animate({ left: 0, opacity: 'toggle'}, 700); } }); }); </script>
success: function(){ $("#formID").animate({ left: 0, opacity: 'toggle'}, 400); $('#normal_player_block').delay(200).animate({ left: 0, opacity: 'show'}, 600).delay(6000).animate({ left: 0, opacity: 'hide'}, 600); $("#formID").delay(6500).animate({ left: 0, opacity: 'toggle'}, 700); document.formID.reset(); }