Hi,
I need help with this. I am trying to figure it out but I can't.
I have 2 pages. I would like to display in the second page the content of one class and hide the content of the other classes.
The idea is make the user to select a language, then display in the next page the content related to the selected option.
This is the code I got so far, but I can't make it work.
###### PAGE 1 ########
[HTML]<html>
<head>
<title></title>
<script type="text/javascript">
function setlang () {
var product = "${customer.product}";
var doc = document.forms[0]['customer.product'];
if (doc){
for(var i=0;i<doc.options.length;i++){
if (doc.options[i].value == product) doc.options[i].selected = true
}
}
}
</script>
</head>
<body onLoad="setlang();">
<form id="lang-form" method="post" action="page2.html" enctype="application/x-www-form-urlencoded">
<table>
<tr>
<td colspan="2" class="selectLanguage center">
<select id="customer.product" name="customer.product" class="small inline">
<option value="">Select</option>
<option value="8a8488010f82a1e6010f82a3ca320093">Spanish</option>
<option value="8a8488010f82a1e6010f82a3ca70009d">French</option>
<option value="8a8488010f82a1e6010f82a3ca9f00ad">Italian</option>
<option value="8a8488010f82a1e6010f82a3ca8000a5">German</option>
</select>
<span class="error">Select Language</span>
</td>
</tr>
<tr>
<td colspan="2">
<label for="customer.firstName">First Name:</label>
<input id="customer.firstName" name="customer.firstName" type="text" class="large" />
</td>
</tr>
<tr>
<td colspan="2">
<label for="customer.lastName">Last Name:</label>
<input id="customer.lastName" name="customer.lastName" type="text" class="large" />
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" alt="Continue" />
</td>
</tr>
</table>
</form>
</body>
</html>[/HTML]
###### EN OF PAGE 1 ########
###### PAGE 2 ########
[HTML]<html>
<head>
<title></title>
<link type="text/css" rel="stylesheet" href="css/global.css" />
<script type="text/javascript">
function Toggle(){
var tagName = document.getElementsByTagName('div');
for(var i=0; i<tagName.length; i++){
tagName[i].className = 'CLASS HERE';
if(tagName[i].className.style.display == 'none') {
tagName[i].className.style.display = 'block';
}
else {
tagName[i].className.style.display = 'none';
}
}
}
//return false;
//}
self.switchContent = function() {
var product = "${customer.product?url}"
if(product == "8a8488010f82a1e6010f82a3ca320093") //Spanish
{
setss('spanish')
}else if(product == "8a8488010f82a1e6010f82a3ca70009d") //French
{
setss('french')
}
else if(product == "8a8488010f82a1e6010f82a3ca9f00ad") //Italian
{
setss('italian')
}
else if(product == "8a8488010f82a1e6010f82a3ca8000a5") //German
{
setss('german')
}
}
</script>
</head>
<body>
<table>
<tr>
<td colspan="2">
<h1 class="spanish">Spanish</h1>
<h1 class="french">French</h1>
<h1 class="italian">Italian</h1>
<h1 class="german">German</h1>
</td>
</tr>
</table>
</body>
</html>[/HTML]
###### EN OF PAGE 2 ########