Visualizzazione dei risultati da 1 a 8 su 8

Visualizzazione discussione

  1. #8
    Utente di HTML.it L'avatar di vic53
    Registrato dal
    Oct 2010
    residenza
    Fonte Nuova (Roma)
    Messaggi
    592
    Se invece fai il filtro sull'input digitato nel campo file
    tramite una funzionejavascript tipo questa?
    codice:
    function CharValidi(myfield, e) {
      var key;
      var keychar;
      if (window.event)
        key = window.event.keyCode;
      else if (e)
        key = e.which;
      else
        return true;
      keychar = String.fromCharCode(key);
      // control keys
      if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
        return true;
      else if ((("abcdefghilmnopqrstuvzwxyjkABCDEFGHILMNOPQRSTUVZWXYJKJ0123456789-_").indexOf(keychar) > -1))
        return true;
      else
        return false;
    } 
    ....
    ...
    e nel campo la chiami con <input type="file" ... onKeyPress="return CharValidi(this, event)"...
    potrebbe semplificare molto?
    ...
    Ultima modifica di vic53; 09-12-2022 a 20:01
    Vic53

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.