ChrisQuick
Programmer
We have a style for buttons (named btn) that we are using on our forms.
Each button represents a department and when clicked loads that department's two primary pages into a frames. As an onclick event, for each button, we are calling a javascript function to determine which button was click determine which pages to load.
At the same time we would like to change the background image of the button so the user can tell where they are.
The buttons have the background image property set to image1.jpg by default and we want to replace it with image2.jpg
The code we have (and this is abbreveated) is this:
<html><head>
<script language="javascript">
function gotoLoc(buttonClicked){
top.parent.main.screenone.location="intro_"+buttonClicked.value+".htm";
top.parent.main.results.location="employees_"+buttonClicked.value+".asp";
buttonClicked.backgroundimage="images/image2.jpg";
}
</script>
</head>
<body>
<input type="button" class="btn" onclick="gotoLoc(this);" value="Dept1" name="Dept1">
<input type="button" class="btn" onclick="gotoLoc(this);" value="Dept2" name="Dept2">
</body></html>
Each button represents a department and when clicked loads that department's two primary pages into a frames. As an onclick event, for each button, we are calling a javascript function to determine which button was click determine which pages to load.
At the same time we would like to change the background image of the button so the user can tell where they are.
The buttons have the background image property set to image1.jpg by default and we want to replace it with image2.jpg
The code we have (and this is abbreveated) is this:
<html><head>
<script language="javascript">
function gotoLoc(buttonClicked){
top.parent.main.screenone.location="intro_"+buttonClicked.value+".htm";
top.parent.main.results.location="employees_"+buttonClicked.value+".asp";
buttonClicked.backgroundimage="images/image2.jpg";
}
</script>
</head>
<body>
<input type="button" class="btn" onclick="gotoLoc(this);" value="Dept1" name="Dept1">
<input type="button" class="btn" onclick="gotoLoc(this);" value="Dept2" name="Dept2">
</body></html>