So currently I have a form like this:
<form method="POST" id="form_upload" enctype="multipart/form-data" action="./dev.html">
<fieldset>
<legend>
Name:
</legend>
<input type="text" class="required" name="file_name" />
</fieldset>
<fieldset>
<legend>
File:
</legend>
<input type="file" name="datafile">
</fieldset>
<input type="submit" value="Upload" />
</form>
I want to submit it without page refresing, via jQuery ajax tools and get my function called (alert for example) on complition. Is it possible and how to do such thing? (If it is possible it shall work in IE 6 BTW...=)
Maybe you can use the jQuery Form Plugin. The code will be something like it:
<script type="text/javascript">
$(document).ready(function() {
$('#form_upload').ajaxForm(function() {
alert("Thank you for your upload!");
});
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With