I try writing code using JavaScript The file sending technology AJAX
HTML code
<form action="" method="post" id="contact_form" enctype="multipart/form-data">
<input type="text" name="name" id="name">
<input type="text" name="email" id="email">
<input type="file" name="cv" id="cv">
<input type="submit" name="submit" id="contacts_send">
</form>
JavaScript code
jQuery(document).ready(function(){
jQuery("#contacts_send").click(function(){
$.ajax({
type : 'POST',
url : 'process_job.php',
dataType : 'json',
data: { cv : $('#cv').val()
name : $('#name').val(),
email : $('#email').val()},
success: function () {
alert("Data Uploaded: ");
}
});
})
})
I researched the internet I did not find a similar solution to my problem I tried this solution but it did not work How can I upload files asynchronously?
i want my code do like this http://www.jainaewen.com/files/javascript/jquery/iframe-post-form.html