ciao. Ho un problema gravissimo con questo script trovato in rete. Lo script serve per fare un minu a linguette. Il mio problema e' che non so memorizzare i dadi di eventuali input sul contenuto di una linguetta....Mi spiego meglio....Se ho la linguetta 1 e la linguetta 2 e nella linguetta 1 ho dei campi input, scrivo qualcosa dentro questi input, poi clikko la linguetta 2 , e quando torno sulla linguetta uno il valore dell'input e' come quando ho visualizzato per la prima volta da linguetta.
Posto il codice in modo che con un semplice copy paste lo troverete subito.
<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;
cursorointer;
}
/* 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;
cursorointer;
}
/* 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 src="images/spacer.gif" width="1" height="3"></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">
<!-- tabella bordata girgio -->
<table border = "1" bordercolor ="#919B9C" cellspacing = "0" cellpadding ="0" width ="530" height="370">
<tr>
<td valign ="top" bgcolor="#F4F3EE">
<!-- inizio tabbed dialog -->
<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 > dati </legend>
<table bgcolor="#F4F3EE" width="400" height ="200" align = "center" valign ="top" cellspacing="10">
<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>
<!-- fine tabbed dialog -->
</td>
</tr>
</table>
<!-- chiusura tabella bordata girgio -->
</td>
</tr>
</table>
</body>
</html>
Posto il codice in modo che con un semplice copy paste lo troverete subito.
<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;
cursorointer;
}
/* 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;
cursorointer;
}
/* 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 src="images/spacer.gif" width="1" height="3"></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">
<!-- tabella bordata girgio -->
<table border = "1" bordercolor ="#919B9C" cellspacing = "0" cellpadding ="0" width ="530" height="370">
<tr>
<td valign ="top" bgcolor="#F4F3EE">
<!-- inizio tabbed dialog -->
<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 > dati </legend>
<table bgcolor="#F4F3EE" width="400" height ="200" align = "center" valign ="top" cellspacing="10">
<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>
<!-- fine tabbed dialog -->
</td>
</tr>
</table>
<!-- chiusura tabella bordata girgio -->
</td>
</tr>
</table>
</body>
</html>