Skip to content

Instantly share code, notes, and snippets.

Created September 10, 2013 13:15
Show Gist options
  • Save anonymous/6509245 to your computer and use it in GitHub Desktop.
Save anonymous/6509245 to your computer and use it in GitHub Desktop.
How to get the free course guide using html/js
<form action="/Home/FreeCourseGuide" id="courseGuideForm" method="post">
<input type="hidden" name="X-Requested-With" value="XMLHttpRequest" />
<input type="text" name="Name" value="" />
<input type="text" name="Email" value="" />
<input type="submit" class="submitButton" value="Get Your Guide Now" />
</form>
<script type="text/javascript">
$(function () {
$('#courseGuideForm .submitButton').submit(function () {
console.log("submit form");
$('#courseGuideForm').ajaxForm(function (result) {
console.log(result);
alert('form successfully submitted');
});
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment