Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125

    menu linguette memorizza valori

    ciao.
    Non spaventatevi dal codice ( che ho ampiamente ripulito lasciando solo html e js.)
    Con un copia incolla mi dite se fa la stesa cosa a voi

    prima il codice
    codice:
    <html>
    <head>
    <title>kkkk</title>
    <link rel = "stylesheet" type = "text/css" href = "../css/hyperlife.css">
    <style type="text/css">
    /*contenuti*/
    .conts {
    	visibility: hidden;
    	left: 0px;
    	top: 0px;
    	position:absolute;
    
    } 
    /* menu linguette non selezionato */
    .tab         { font-family: Verdana; font-size: 8pt; font-weight: normal; text-align: center; 
                   border-left: thin solid #e0e0e0; 
                   border-right: none; 
                   border-top: thin solid #e0e0e0; 
    				width:115px;
                   cursor:pointer;
    
    				
                   }
    /* menu linguette selezionato */
    .selTab      { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center; 
                   border-left: thin solid #919B9C; 
                   border-right: thin solid #919B9C;
                   border-top: thin solid #919B9C;
                   background:#F4F3EE;
    			   width:115px;
                   cursor:pointer;
    			   
                    }
    
    /* tabella generale menu linguette*/
    .tabbedDialog
    {
    	font-family: Verdana; font-size: 8pt; font-weight: normal;
    	background-color: #F0F0E6;
    	WIDTH: 100%; HEIGHT:100%;
    }
    </style>
    <script language="javascript" src="../functions/common.js"></script>
    <script language="javascript">
    	
    var currentTab; 
    var tabBase; 
    var firstFlag = true; 
    
    
    var s_sessName;
    
    
    window.onload=function(){
    init();
    }
    
    //sets the default display to tab tab
    function init(){ 
    	document.getElementById("tabContents").innerHTML = document.getElementById("t1Contents").innerHTML;
    }
    
    function rememberFields(){
    	fields = new Array();
    	s_sessName = document.getElementById('local').value; 
    	document.getElementById('local').value = s_sessName;	
    }
    
    
    //a public function that the container uses to pass in values for the card containers 
    function public_Contents(contents1, contents2){ 
    document.getElementById("t1Contents").innerHTML = contents1; 
    document.getElementById("t3Contents").innerHTML = contents3; 
    init(); 
    } 
    
    function changeTabs(tabID){
    	rememberFields();
    	if(firstFlag == true){ 
    	currentTab 	= document.getElementById("t1"); 
    	tabBase 	= document.getElementById("t1base"); 
    	firstFlag = false; 
    	} 
    	if(document.getElementById(tabID).className == "tab"){ 
    		currentTab.className 			= "tab"; 
    		tabBase.style.backgroundColor 	= "#919B9C"; 
    		currentTab 						= document.getElementById(tabID); 
    		tabBaseID 						= currentTab.id + "base"; 
    		tabContentID 					= currentTab.id + "Contents"; 
    		tabBase 						= document.getElementById(tabBaseID); 
    		tabContent 						= document.getElementById(tabContentID); 
    		currentTab.className 			= "selTab"; 
    		tabBase.style.backgroundColor 	= ""; 
    		document.getElementById("tabContents").innerHTML = tabContent.innerHTML; 
    	
    	} 
    } 
    
    	var premuto=0;
    	
    	function popupCentrata(width,height){
    		var dim 		= new Array();
    		var w 			= width;
    		var h 			= height;
    		dim['left'] 	= Math.floor((screen.width-w)/2)+270;
    		dim['top'] 		= Math.floor((screen.height-h)/2);
    		dim['width']	= w;
    		dim['height']	= h;
    		return dim;
    	}					
    	
    	
    	function controlla(){
    		var localname = document.getElementById("local").value;
    		document.getElementById('theForm').submit();		
    	}
    	
    
    
    	
    </script>
    </head>
    <body>
    
      <table  bgcolor ="#ECE9D8" width = "100%" height = "100%" border ="0" bordercolor ="black"cellspacing="0"  >
        <tr valign = "top" align="left">
          <td  height="3">[img]images/spacer.gif[/img]</td>
        </tr>
        <tr valign = "top" align ="left" >
          <td align = "center" valign = "top" height="10">
    	     <table  width="530" align="center"  cellspacing="0"  border ="0" bordercolor ="green">
    			<tr> 
    			  <td class="selTab" onclick="changeTabs('t1')"  id="t1">Session Info</td>
    			  <td class="tab" onclick="changeTabs('t3')"  height="25" id="t3" >General Settings</td> 
    			</tr> 
    			<tr> 
    			  <td id="t1base" style="	BORDER-LEFT: gray thin solid; HEIGHT:2px; "  ></td> 
    			  <td id="t3base" style="BACKGROUND-COLOR: #919B9C; HEIGHT: 2px; "></td> 	
    			</tr> 
    		 </table>
           </td>	
        </tr>
        <tr>
    	  <td align ="center" valign="top" height="100">
    	   	  	
    	      <table border = "1" bordercolor ="#919B9C" cellspacing = "0" cellpadding ="0" width ="530" height="370">
    	       <tr>
    		    <td valign ="top"  bgcolor="#F4F3EE">
    		     	
    			 <table  width="100%" align = "center" cellspacing="0" border ="0" bordercolor ="blue">		
    			  <tr> 
    			   <td id="tabContents" ></td> 
    			  </tr>
    			 
    			  <tr >
    			    <td valign ="top">	
    				 <div class="conts" id="t1Contents" >
    				 <form name = "theForm" id="theForm" action = "ricevi.php" method = "post" >
    				  	<fieldset style="width:500px;height:180px;"  align = "center">
    			<legend > 90089809</legend>
    				
    					<table bgcolor="#F4F3EE" width="400" height ="200" align = "center" valign ="top" cellspacing="10">
    		            <tr valign="top">
                          <td width = "400" align="left"><img id="icon" src = "images/sess.png" border="0" alt  =""></td>
                          <td></td> 
                          <td></td>
                        </tr>
                       	      
                        <tr>
                          <td align="left">Name:</td>
                          <td></td>
                          <td><input type = "text" name = "sessName" id="local" ></td>
                        </tr>
                        
             
                       </table>
                       </fieldset>
    	                  
    	                 </form>  
    				 </div> 
    				 <div class="conts" id="t3Contents" >
    				 	seconda tabbed
    				 
    				 </div>	
    			   </td>
    			 </tr> 	
    		   </table>
    	 
    		 </td>
    	   </tr>
         </table>
          		
        </td>
       </tr>
       <tr valign="top"><td valign="middle">
        <table align="right">
           <tr>
             <td><input type="button" onClick="controlla();" class = "myInput"  value="OK"></td>
            
           </tr>
        </table>  
       </td>
    </tr>   
     </table>
    </body>
    </html>

    si tratta di un menu a linguette. Nella prima linguetta visualizza un campo input...
    Premettendo che gia il form con i div dava problemi...ora e' a posto.
    Unica menata che se io scrivo qualcosa nel campo input e poi cambio linguetta....quando torno sulla prima linguetta non si ricorda cosa avevo scritto...anzi.....mi mette il valore del value dell'input.


    Come posso far si che se mi muovo nelle pagine del menu a linguette nossa sembre vedere tutti i mie valori?

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    up

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    up

  4. #4
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    up

  5. #5
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    mi sfugge il motivo del perche' tu legga e riscriva l' innerHTML di un pannello quando normalmente se ne cambia solo il display x renderlo visibile/invisibile...
    il problema non sussisterebbe
    ed in + il tuo codice sarebbe moooooolto + lineare e pulito

  6. #6
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    ciao xinod...

    il codice che ho scritto non e' totalmente farina del mio sacco...l'ho copiato da qui
    http://simplythebest.net/scripts/DHT...script_16.html

    A questo punto pero' chiedo il tuo aiuto...
    Come posso far si che se mi muovo nelle linguette possa sempre vedere tutti i mie valori?

    (es : sulla prima tabbed, in un input scrivo pippo, poi passo alla tabbed 2 ...poi torno sulla 1 e nell'input c'e' ancora scritto pippo)

  7. #7
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    no, senti, non perdiamo tempo entrambi e fallo col display
    dovrebbe esserci un articolo anche su pro.html.it
    altrimenti cerca con google "dhtml tab"
    ciao

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.