jQuery and Ajax is used to upload file from HTML form to server without form submission
สมมติว่า ฟอร์ม HTML เป็นตามด้านล่าง
Assume that HTML form is below
<form id="form-id" action="upload.php" enctype="multipart/form-data" method="post"> <table style="width: 100%;"> <tbody> <tr> <th><label for="id_path_program">Path program:</label></th> <td><input id="id_path_program" name="path_program" type="file"></td> </tr> <tr> <th><label for="id_description">Description:</label></th> <td><input id="id_description" maxlength="250" name="description" type="text"></td> </tr> </tbody> </table> <input type="submit" value="Upload"/> </form>