Skip to content

Instantly share code, notes, and snippets.

@psawaya
Created January 5, 2012 19:13
Show Gist options
  • Save psawaya/1566720 to your computer and use it in GitHub Desktop.
Save psawaya/1566720 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="static/js/jquery-1.7.1.min.js"></script>
<script src="static/js/jquery.form.js"></script>
<script>
$(document).ready(function() {
$('#blogForm').submit(function(e) {
$(this).ajaxSubmit({
target: '#entries'
});
alert("Thank you for your comment!");
e.preventDefault();
return false;
});
});
</script>
</head>
<body>
<ul id="entries">
{% include "entries.html" %}
</ul>
<form method="POST" action="/submit" id="blogForm">
<div>
<input type="text" name="entryTitle"/>
</div>
<div>
<textarea name="blogText" rows=15 cols=40></textarea>
</div>
<div>
<strong>By: </strong> <input type="text" name="authorName"/>
</div>
<div>
<input type="submit" value="Blog"/>
</div>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment