RSH17
11-06-2004, 03:42 PM
Reference: IE 6 & JavaScript
How do I code the onclick event of a button to execute a switch statement?
I wish to use the onclick event of button4 to execute a switch statement to change the value of button1.
<Language=JavaScript>
<INPUT type="button" value="Castings" id=button1 name=button1 >
<INPUT type="button" value="Raw Materials" id=button4 name=button4 onclick = "Raw Material">
<script>
Article = document.MaterialSelector.button4.value
switch (Article) {
case "Raw Material":
document.MaterialSelector.button1.value
break;
default:
break;
}
</script>
How do I code the onclick event of a button to execute a switch statement?
I wish to use the onclick event of button4 to execute a switch statement to change the value of button1.
<Language=JavaScript>
<INPUT type="button" value="Castings" id=button1 name=button1 >
<INPUT type="button" value="Raw Materials" id=button4 name=button4 onclick = "Raw Material">
<script>
Article = document.MaterialSelector.button4.value
switch (Article) {
case "Raw Material":
document.MaterialSelector.button1.value
break;
default:
break;
}
</script>