Take only part of the input content without submitting [duplicate]

1

I am creating a gallery of images using the responsivefilemanager plugin and there is a problem that I can not solve.

See this image:

Clickingthebluebutton(Withthefoldersymbol)opensaModalinwhichIcancreatefolders,uploadimagesetc.WhenIselectthefolder,thescreenclosesandthefolderpathisreturnedintheInput,butI'mhavingahardtimedealingwiththis,becauseIactuallyonlywantedtheendoftheURL(foldername).

SoIask,howcanIresolvethissituation?IneedtogetthevaluewithoutsubmittingsoIcannotuse$_GET...

Hereisthecodeformybutton

<divclass="col-xs-4  col-md-4">
    <label for="pasta">Pasta:</label>
    <!-- Campo Pasta e Seleção de Imagens-->
    <div class="input-group">
        <span clas="input-group-btn text-center">
            <a href=<?=(Empty($dir))?"/assets/libs/filemanager/dialog.php?type=2&field_id=folder": "/".$dir."/assets/libs/filemanager/dialog.php?type=2?type=2&field_id=folder"?> class="btn btn-info fancy" data-fancybox-type="iframe">
                <i class="fa fa-folder-open-o"></i>
            </a>
        </span>                                     
        <input type="text" placeholder="Pasta" class="form-control" name="folder" id="folder" onchange="buscar('medium')" value="">   
    </div>     
</div> 
    
asked by anonymous 24.08.2017 / 05:01

1 answer

1

When choosing the file, you can use the following callback function to process the changes you want to make:

function responsive_filemanager_callback(field_id){
    console.log(field_id);
}

Another option would be to use the fancybox modal closing callback.

    $("<YOUR-SELECTOR>").fancybox({ 
        afterClose: function() { 
        // adicionar aqui o tratamento para pegar o nome do arquivo e adicionar no campo 
        }) 
    });
    
24.08.2017 / 05:53