framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

file input

Open lws68825 opened this issue 10 years ago • 7 comments

Hi, Does framework7 support form including file input element?

lws68825 avatar Feb 09 '16 07:02 lws68825

try

<input class="button button-big button-fill" type='file' id='_file' accept="image/*;capture=camera">

css

.custom-file-input 
        {
            display: inline-block;
            position: relative;
            color: #FFFFFF;
        }
        .custom-file-input input 
        {
            visibility: hidden;                 
        }
        .custom-file-input:before 
        {
            content: '\f030  seleccionar';
            font-family: FontAwesome;
            display: block;
            background: -webkit-linear-gradient( -180deg, #007AFF, #007AFF);
            background: -o-linear-gradient( -180deg, #007AFF, #007AFF);
            background: -moz-linear-gradient( -180deg, #007AFF, #007AFF);
            background: linear-gradient( -180deg, #007AFF, #007AFF);
            border: 3px solid #007AFF;
            border-radius: 10px;
            padding: 5px 0px;
            width: 40%;
            outline: none;
            white-space: nowrap;
            cursor: pointer;
            text-align: center;
            font-size: 12pt;
            position: absolute;
            left: 0;
            right: 0;
        }
        .custom-file-input:hover:before 
        {
            border-color: #007AFF;
        }
        .custom-file-input:active:before 
        {
            background: #007AFF;
        }   

mobile_record

chalchis avatar Feb 10 '16 00:02 chalchis

@chalchis, thank you very much for your wonderful reply.

lws68825 avatar Feb 10 '16 02:02 lws68825

Please close the issue if the answer is expected

chalchis avatar Feb 10 '16 17:02 chalchis

Another way

input_file

css

 /*input file*/
    .fileUpload 
    {
        position: relative;
        overflow: hidden;           
    }

    .fileUpload input.upload 
    {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0;
        padding: 0;
        font-size: 20px;
        cursor: pointer;
        opacity: 0;
        filter: alpha(opacity=0);
    }

    .ico_upload
    {
      padding-left: 8px; font-size:25px
    }

  +'<div class="list-block inputs-list theme-indigo">'
                        +'<div class="item-content">'
                            +'<div class="item-media button button-raised button-fill color-indigo fileUpload">'
                                +'<span class="ico_upload"><i class="fa fa-paperclip" aria-hidden="true"></i></span>'
                                +'<input id="tx_file_programa" type="file" class="upload"/>'
                            +'</div>'
                            +'<div class="item-inner">'
                              +'<div class="item-title floating-label">Archivo seleccionado</div>'
                              +'<div class="item-input">'
                                +'<input id="file_lectura" readonly type="text" placeholder=""/>'
                              +'</div>'
                            +'</div>'
                        +'</div>'
                    +'</div>'

js
$$(document).on('change', '#tx_file_programa', function() 
{
    //focus
    $$('#file_lectura').focus();

    //show value file
    $$('#file_lectura').val(this.value);
});


chalchis avatar Jun 10 '16 07:06 chalchis

@chalchis , it is fantastic, thank you very much!

lws68825 avatar Jun 12 '16 12:06 lws68825

Does framework7 support form including audio files ?

Svetoslav0712 avatar Jul 25 '17 14:07 Svetoslav0712

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jun 25 '18 01:06 lock[bot]