Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. blacco
    3. Post
    B

    blacco

    @blacco

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 0
    • Post 1
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 17
    0
    Reputazione
    1
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da blacco

    • RE: Riempimento input automatico

      Ti posto la soluzione più banale ( e pure meno sicura nel caso tu commetta errori nella "parte" relativa al php):

      
      if ( typeof XMLHttpRequest == "undefined" ){
          XMLHttpRequest = function(){
              return new ActiveXObject(
              navigator.userAgent.indexOf("MSIE 5") >= 0 ?
              "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"
              );
          };
      }
      
      function get_field_data(){
          var xhr = new XMLHttpRequest();
          xhr.open('GET','foo.php');
          xhr.onreadystatechange = function() 
              if((xhr.readyState == 4) && (xhr.status == 200)) 
                  eval(xhr.responseText);
          xhr.send(null);
      }
      
      ```a questo punto, aggiungi all'elemento che ti interessa, la voce
      

      onblur ="get_field_data()"

      document.getElementById('campo1') = valore 1 ottenuto dall'array;
      document.getElementById('campo2') = valore 2 ottenuto dall'array;
      e cosi via.

      
      PS: la pagina php dovrà ritornare del codice javascript valido, per fare in modo che poi attraverso eval esso venga eseguito.
      postato in Coding
      B
      blacco