ie javascript form submit with file input

后端 未结 8 541
-上瘾入骨i
-上瘾入骨i 2020-12-02 17:35

I have a html form, with a custom file upload field. And by that I mean that I have moved the actual file field beyond the borders of the page with css, that I have a custom

8条回答
  •  一生所求
    2020-12-02 17:51

    If you're like me, and you don't want to use an iframe, and you weren't too keen on the label solution mentioned above, you can just position the original button above the styled button with an opacity of 0.

    Using the example above, you would still have:

    
    
    

    But .hidden would be defined like so:

    .hidden {
      position: absolute;
      left: -150px;
      opacity: 0;
      filter: alpha(opacity=0);
    }
    

    Config: Set the opacity to 0.5 (or =50) to see the transparent element and tweak the left positioning.

    Arguably just as hacky as the answers above, but a bootstrap-friendly solution, and in my case, the only one that worked.

提交回复
热议问题