简体   繁体   English

如何在laravel中更改按钮的值

[英]How to change value of button in laravel

{{ Form::open(array('' => 'menu/profile', 'files' => true)) }}
{{ Form::file('image') }}

{{ Form::submit('Save changes') }}
{{ Form::close() }}

{{ Form::file('image') }} 

This gives me button with value=browse. 这为我提供了value = browse的按钮。 Can i change that to for example upload, and also near that button is "no file selected". 我可以将其更改为例如上载吗,并且该按钮附近也为“未选择文件”。 Can i hide that somehow? 我可以以某种方式隐藏它吗?

This is not laravel related, but browser specific. 这不是与laravel相关,而是特定于浏览器。 it will say "browse" in IE and FireFox, but "choose file" in Chrome. 在IE和FireFox中会显示“浏览”,而在Chrome中显示“选择文件”。

There are some workarounds for it, but its better to not change browser defaults. 有一些解决方法,但是最好不要更改浏览器默认值。 However if you still want to change the file input check here 但是,如果您仍然想更改文件输入,请在此处进行检查

its not larval MVC issue. 它不是幼虫的MVC问题。

but yes you can fix this issue using below Possible Solutions: 但是可以,您可以使用以下可能的解决方案解决此问题:

hack

input[type='file'] {
  opacity:0    
}

or 要么

set width / height 设定宽度/高度

input[type="file"]{
    opacity:0;
    height:48px;
    width:48px;
}

or just play with width 或只是玩宽度

input[type='file'] {
  width: 95px;
 }

Tested on Chrome 20, Safari 5.1.7 and IE 9. 已在Chrome 20,Safari 5.1.7和IE 9上进行测试。

or Make it transparent 或使其透明

input[type='file'] {
  color: transparent;
}

<input type='file'/>

example enter link description here 示例在此处输入链接描述

See link : 见链接:

http://geniuscarrier.com/how-to-style-a-html-file-upload-button-in-pure-css/ http://geniuscarrier.com/how-to-style-a-html-file-upload-button-in-pure-css/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM