- Fill a JavaScript array with all the information associated with the various form fields.
- When the visitor makes a selection, use client-side script to pull the appropriate information and display it.
<html><head><script type="text/javascript">
var barks = new Array()
barks[1] = "wwwWoof! wwwWoof-woof? "
barks[2] = "Arf! Arf! Rf!"
barks[3] = "ruff-Ruff! ruff-Ruff!"
function showBark(val) {
alert(barks[val])
}
</script>
<body>
<input type="radio" name="barks"
onclick="showBark(this.value)"
value="1">Spot</input>
<input type="radio" name="barks"
onclick="showBark(this.value)"
value="2">Spottie</input>
<input type="radio" name="barks"
onclick="showBark(this.value)"
value="3">Caesar</input>
</body></html>
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.