ajax php form submit
The form is submitting after the ajax request.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(function () {
$('form').on('submit', function (e) {
e.preventDefault();
$.ajax({
type: 'post',
url: 'post.php',
data: $('form').serialize(),
success: function () {
alert('form was submitted');
}
});
});
});
</script>
</head>
<body>
<form>
<input name="time" value="00:00:00.00"><br>
<input name="date" value="0000-00-00"><br>
<input name="submit" type="submit" value="Submit">
</form>
</body>
</html>
Also in PHP:
- create laravel new project
- capitalise in php
- file_get_contents get content error ssl get errors
- ajout d'heure à une date php
- error reporting ini set dusplay errors
- convert to capital letters php
- clear cach laravel
- fetch files from directory php
- change background color with user option
- THROW EXPECTION PHP
- check table exists in db laravel
- 1071 Specified key was too long;
- check if date is within range php
- datae php
- convert date to timetamp in php
- charcter count in php
- catch in php
- How to get the current time in PHP if
- Create image data URIs (base64) using PHP Raw
- -5 php change timezone
- cannot use font awesome in php mvc
- collection empty laravel
- check in string is part oof other string php
- ->orderBy('id', 'ASC'); laravel