Skip to content

Instantly share code, notes, and snippets.

@akhmadkresna
Created July 8, 2018 14:29
Show Gist options
  • Save akhmadkresna/a3766ebc8a6c6b988ba99764d611a6f6 to your computer and use it in GitHub Desktop.
Save akhmadkresna/a3766ebc8a6c6b988ba99764d611a6f6 to your computer and use it in GitHub Desktop.
odoo get file name from website
<div class="col-md-7 col-sm-8">
<input id="upload" type="file" class="form-control o_website_form_input" name="file" required=""/>
<input id="upload_name" type="text" class="form-control o_website_form_input" name="filename" required=""/>
</div>
<script>
$(function(){
$('#upload').change(function(e){
var fileName = e.target.files[0].name;
alert('The file "' + fileName + '" has been selected.');
$('#upload_name').val(fileName)
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment