Visualizzazione dei risultati da 1 a 10 su 17

Hybrid View

  1. #1
    Utente di HTML.it L'avatar di badaze
    Registrato dal
    Jun 2002
    residenza
    Lyon
    Messaggi
    5,372
    Infatti qualcosa è fattibile. E' solo un esempio.

    Mettere i due files nella stessa cartella.

    File : test100a.html
    Codice PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <
    html>
    <
    head>
    <
    title>Untitled</title>
    <
    script language="JavaScript" type="text/javascript">
    <!--
    function 
    pippo() {
     
     
    textToCompare document.getElementById('my_text').value;
     if (
    document.frames != null) {
      var 
    inputTags document.frames('my_frame').document.getElementsByTagName('input');
     } else {
      var 
    inputTags document.getElementById('my_frame').contentWindow.document.getElementsByTagName('input');
     }
     
    conta    inputTags.length;
     
    cliccato false;
     
     for (
    i=0;i<conta;i++) {
      var 
    curInput inputTags[i];
      if (
    curInput.type.toUpperCase() == ('button').toUpperCase() && curInput.value.toUpperCase() == textToCompare.toUpperCase()) {
      
    cliccato true;
      
    curInput.click();
     } 
    // if (curInput.type.toUpperCase() == ('button').toUpperCase() && .....
     
    //  for (i=0;i<conta;i++)
     
     
    if (!cliccato) {
      
    alert("Nessun bottone trovato con il testo '"+textToCompare+"'");
     } 
    //  if (!cliccato) 
     
    // function pippo()
    //-->
    </script>
    </head>
    <body>
    <iframe src="test100b.html" id="my_frame" name="my_frame" height="400" width="600" ></iframe>
    <br/><br/>
    Immettere il testo del bottone da cliccare :
    <input type="text" id="my_text" value='Tre' /><input type="button" value="Invio" onclick="pippo()"/> 
    </body>
    </html> 
    File : test100b.html

    Codice PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <
    html>
    <
    head>
    <
    title>Untitled</title>
    </
    head>
    <
    body>
    Sono il frame.<br>
    <
    input type="button" value="Uno" id="my_button1" onclick="document.getElementById('my_div1').style.display='inline'"/>
    <
    div id="my_div1" style="display:none">
    Messaggio da bottone Uno => Mi hai cliccato !!!
    </
    div>
    <
    br/><br/>
    <
    input type="button" value="Due" id="my_button2" onclick="document.getElementById('my_div2').style.display='inline'"/>
    <
    div id="my_div2" style="display:none">
    Messaggio da bottone Due => Mi hai cliccato !!!
    </
    div>
    <
    br/><br/>
    <
    input type="button" value="Tre" id="my_button3" onclick="document.getElementById('my_div3').style.display='inline'"/>
    <
    div id="my_div3" style="display:none">
    Messaggio da bottone Tre => Mi hai cliccato !!!
    </
    div>
    <
    br/><br/>
    <
    input type="button" value="Uno" id="my_button4" onclick="document.getElementById('my_div4').style.display='inline'"/>
    <
    div id="my_div4" style="display:none">
    Messaggio da bottone Uno => Mi hai cliccato !!!
    </
    div>
    </
    body>
    </
    html
    Ridatemi i miei 1000 posts persi !!!!
    Non serve a nulla ottimizzare qualcosa che non funziona.
    Cerco il manuale dell'Olivetti LOGOS 80B - www.emmella.fr

  2. #2
    Non può non partire per te, badaze, un applauso alla sportività, sia quel che sia, possa o non possa il tuo codice essere determinante per portare in porto il progetto, lo esaminiamo con un interesse e una curiosità fuori dal comune, sicuro!

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.