Created
April 16, 2012 19:41
-
-
Save OndraM/2401014 to your computer and use it in GitHub Desktop.
jQuery form plugin issue #180 demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" > | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script> | |
<script type="text/javascript" src="http://malsup.github.com/jquery.form.js"></script> | |
</head> | |
<script> | |
$(document).ready(function() { | |
$('#ajax-form').ajaxForm({ | |
target: $('#ajax-form-target') | |
}); | |
$('form').submit(); | |
}) | |
</script> | |
<body> | |
<p> | |
Both forms send empty on document ready. | |
</p> | |
<h2>Ajax form (result shown in target)</h2> | |
<form id="ajax-form" method="post" enctype="multipart/form-data" action="post.php"> | |
<input type="file" name="file"> | |
<input type="submit" value="Send"> | |
</form> | |
<pre id="ajax-form-target" style="border: 1px solid black;"></pre> | |
<h2>Standard form (result shown in iframe)</h2> | |
<form method="post" enctype="multipart/form-data" action="post.php" target="iframe"> | |
<input type="file" name="file"> | |
<input type="submit" value="Send"> | |
</form> | |
<iframe name="iframe" src="post.php" style="border: 1px solid black;"></iframe> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_SERVER['REQUEST_METHOD'] == "POST") { | |
var_dump($_FILES); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment