Trying to use jQuery form plugin in wordpress site to upload files.
HTML markup:
<form id="myForm" action="process.php" method="POST" enctype="multipart/form-data">
<input type="file" value="" name="file_upload" class="file_upload"/> <br></br>
<input type="submit" value="Submit" class="btn_submit" name="btn_submit" />
</form>
and the JS snippet :
<script type="text/javascript">
$(document).ready(function() {
$('#myForm').ajaxForm(function() {
alert("Thank you for your comment!");
});
});
</script>
The form processes its element values in process.php
which is a non-template file. As a result Wordpress codex functions are not available in that page . So what I need to do is to use the jQuery form plugin's ajax submission in the wordpressian way.
How to implement that ?