Ok this really shouldn't be that hard...but I can not figure out whats' wrong for the life of me. I am brand new to "coding" and have thus far just built basic sites with Dreamweaver, but am going through my CIW certs, and this is an exercise i am feeling a little "dumb'' on.... any help....
Question exactly as it's worded: Create a Web page that contains an HTML form, a list box, a button and an <img> tag. Populate the list box with at least 3 people's names and the names of three images located in the same directory; you will also need those image files accessible from the server. Use the 'onClick' event of the button object to read the attributes of the list box that store the currently selected names and associated image name. Use the JavaScript 'Load' method to script the <img> tag to load the image associated with the name.
Now my "instructor " made a super simple example that worked, but I can not for the life of me duplicate it and actually get it to work. I am sure there are "better" ways to acheive this goal, but I am trying to do it how they want... here is the "instructor s" example he gave me
<html>
<head>
<title> blah blah blah</title>
<script type="text/javascript">
function Load()
{
document.getEle mentById("Image s").src=
document.getEle mentById("faces ").value
}
</script>
</head>
<body>
<img id="Images" src="face1.jpg" >
<select name="faces">
<option value=""> Select a face
<option value="face1.jp g">Face1
<option value="face1.jp g">Face2
<option value="face1.jp g">Face3
<option value="face1.jp g">Face4
</select>
<input type="submit" onClick="Load() " value="selecxt" >
</body>
</html>
--------------------------------------------
Does this make sense?? I really need some advice from anyone that knows how to "complete the exercise" i am getting really frustrated....
THANKS SO MUCH!!!!!!!!!!! !!!!
Question exactly as it's worded: Create a Web page that contains an HTML form, a list box, a button and an <img> tag. Populate the list box with at least 3 people's names and the names of three images located in the same directory; you will also need those image files accessible from the server. Use the 'onClick' event of the button object to read the attributes of the list box that store the currently selected names and associated image name. Use the JavaScript 'Load' method to script the <img> tag to load the image associated with the name.
Now my "instructor " made a super simple example that worked, but I can not for the life of me duplicate it and actually get it to work. I am sure there are "better" ways to acheive this goal, but I am trying to do it how they want... here is the "instructor s" example he gave me
<html>
<head>
<title> blah blah blah</title>
<script type="text/javascript">
function Load()
{
document.getEle mentById("Image s").src=
document.getEle mentById("faces ").value
}
</script>
</head>
<body>
<img id="Images" src="face1.jpg" >
<select name="faces">
<option value=""> Select a face
<option value="face1.jp g">Face1
<option value="face1.jp g">Face2
<option value="face1.jp g">Face3
<option value="face1.jp g">Face4
</select>
<input type="submit" onClick="Load() " value="selecxt" >
</body>
</html>
--------------------------------------------
Does this make sense?? I really need some advice from anyone that knows how to "complete the exercise" i am getting really frustrated....
THANKS SO MUCH!!!!!!!!!!! !!!!
Comment