I want to get the filename of a file user selected when a user clicks on a button it is not a submit button. I have tried many of the solutions given on stackoverflow but it does not work i have id of the field but it does not give the name of the file.
Below is my code:
function Data(a)
{
var ext = $('#fieldid_'+a).val().split('.').pop().toLowerCase();
.......
<input type="file" name="save_<?=$row1['id']?>" id="fieldid_<?=$row1['id']?>" />
<input type="button" id="submit_<?=$row1['id']?>" value="Upload File" onclick = "return Data(<?=$row1['id']?>)"/>