neil9999
01-20-2004, 12:04 PM
Hi,
Here's my new code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script language="javascript">
function stht(nort){
if(nort=="txt"){
var wif=document.getElementById('selectbx').value;
}
var nortt=nort;
if(wif=="cat" || nortt==2){
var txtbx="Cats are very nice animals indeed.";
nortt==2;
}
else if(wif=="dog" || nortt==3){
var txtbx="Dogs are also very nice animals indeed!";
nortt==3;
}
else if(wif=="blk" || nortt==1){
var txtbx="Select an option!!!";
nortt==1;
}
var nortp=nortt+1;
var nortm=nortt-1;
alert(nortm)
document.getElementById('infobx').innerHTML=txtbx;
document.getElementById('backbt').innerHTML="<button onclick=\"stht("+nortm+")\">Back</button>";
document.getElementById('nextbt').innerHTML="";
}
</script>
</head>
<body>
<table border="1" style="width: 300; height:300">
<tr>
<td style="width: 150; height:150">
<p align="center">Pets</p>
</td>
<td style="width: 150; height:150">
<select size="1" name="D1" onchange="stht('txt')" id="selectbx">
<option selected value="blk">blank</option>
<option value="cat">Cat</option>
<option value="dog">Dog</option>
</select>
<p> </td>
</tr>
<tr>
<td style="width: 150; height:150" id="infobx">
<p align="center">Info</p>
</td>
<td style="width: 150; height:150"> </td>
</tr>
<tr>
<td style="width: 150; height:150" id="backbt">
</td>
<td style="width: 150; height:150" id="nextbt"> </td>
</tr>
</table>
<button onclick="stht(1)">
</button>
</body>
</html>
When you select an animal, some text appears about it in the middle-lefthand box. In the bottom-left box appears a 'back' button. When you click this, it should simulate clicking on the previous entry in the drop-down menu. What i get is 'undefined' in the middle-left box when you click the back button.
This is what happens:
Each option in the drop-down menu is assigned a number: blank is 1, cat is 2 and dog is 3. The back button is assigned that number minus 1. That way, when you click on the button, it should show the info for that number. So if you select dog, the back button is assigned 2. When you click on the back button, the info for the animal assigned no. 2 (cat) is shown, and the cycle's repeated.
Thankyou,
Neil
Here's my new code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script language="javascript">
function stht(nort){
if(nort=="txt"){
var wif=document.getElementById('selectbx').value;
}
var nortt=nort;
if(wif=="cat" || nortt==2){
var txtbx="Cats are very nice animals indeed.";
nortt==2;
}
else if(wif=="dog" || nortt==3){
var txtbx="Dogs are also very nice animals indeed!";
nortt==3;
}
else if(wif=="blk" || nortt==1){
var txtbx="Select an option!!!";
nortt==1;
}
var nortp=nortt+1;
var nortm=nortt-1;
alert(nortm)
document.getElementById('infobx').innerHTML=txtbx;
document.getElementById('backbt').innerHTML="<button onclick=\"stht("+nortm+")\">Back</button>";
document.getElementById('nextbt').innerHTML="";
}
</script>
</head>
<body>
<table border="1" style="width: 300; height:300">
<tr>
<td style="width: 150; height:150">
<p align="center">Pets</p>
</td>
<td style="width: 150; height:150">
<select size="1" name="D1" onchange="stht('txt')" id="selectbx">
<option selected value="blk">blank</option>
<option value="cat">Cat</option>
<option value="dog">Dog</option>
</select>
<p> </td>
</tr>
<tr>
<td style="width: 150; height:150" id="infobx">
<p align="center">Info</p>
</td>
<td style="width: 150; height:150"> </td>
</tr>
<tr>
<td style="width: 150; height:150" id="backbt">
</td>
<td style="width: 150; height:150" id="nextbt"> </td>
</tr>
</table>
<button onclick="stht(1)">
</button>
</body>
</html>
When you select an animal, some text appears about it in the middle-lefthand box. In the bottom-left box appears a 'back' button. When you click this, it should simulate clicking on the previous entry in the drop-down menu. What i get is 'undefined' in the middle-left box when you click the back button.
This is what happens:
Each option in the drop-down menu is assigned a number: blank is 1, cat is 2 and dog is 3. The back button is assigned that number minus 1. That way, when you click on the button, it should show the info for that number. So if you select dog, the back button is assigned 2. When you click on the back button, the info for the animal assigned no. 2 (cat) is shown, and the cycle's repeated.
Thankyou,
Neil