diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 6884df265..e30ca8bed 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -1350,6 +1350,14 @@ background-image: linear-gradient(to bottom, #882222, #111111);; function printFileChooserJs() { /* {{{ */ ?> $(document).ready(function() { +/* do not use bootstrap4 custom form element because it is difficult to localize + $(document).on('change', '.custom-file-input',function(){ + //get the file name + var fileName = $(this).val().replace(/\\/g, '/').replace(/.*\//, ''); + //replace the "Choose a file" label + $(this).next('.custom-file-label').html(fileName); + }) +*/ /* Triggered after the file has been selected */ $(document).on('change', '.btn-file :file', function() { var input = $(this), @@ -1374,6 +1382,15 @@ $(document).ready(function() { function getFileChooserHtml($varname='userfile', $multiple=false, $accept='') { /* {{{ */ $id = preg_replace('/[^A-Za-z]/', '', $varname); +/* do not use bootstrap4 custom form element because it is difficult to localize + $html = ' +
+ + +
+'; + return $html; + */ $html = '