Hi,
I'm trying to write an onchange event for a select, dropdown box ("SelState". When a particular state is chosen (there are six diff states in dropdown), I want to populate a second select, dropdown box ("Products" with different values.
I'm not sure how to populate the 2nd dropdown based on what is selected in the first. The code below is an example, though, of what I'm trying to do.
function FillSubject()
{
if (SelState.value = "MA"
<select id="Products" name="Products">
<option value=Paper>Paper
<option value=Cartridges>Cartridges
if (SelState.value = "NY"
<select id="Products" name="Products">
<option value=Paper>Paper
<option value=Printers>Printers
</script>
<select id="Products" onchange="FillSubject()" name="Products">
I repeat the select name and id tags for the second dropdown ("Products" each time I refer to it. I know that's not right but I'm not sure how else to approach (don't have much experience with javascript).
Thanks for any help.
MBaddar
I'm trying to write an onchange event for a select, dropdown box ("SelState". When a particular state is chosen (there are six diff states in dropdown), I want to populate a second select, dropdown box ("Products" with different values.
I'm not sure how to populate the 2nd dropdown based on what is selected in the first. The code below is an example, though, of what I'm trying to do.
function FillSubject()
{
if (SelState.value = "MA"
<select id="Products" name="Products">
<option value=Paper>Paper
<option value=Cartridges>Cartridges
if (SelState.value = "NY"
<select id="Products" name="Products">
<option value=Paper>Paper
<option value=Printers>Printers
</script>
<select id="Products" onchange="FillSubject()" name="Products">
I repeat the select name and id tags for the second dropdown ("Products" each time I refer to it. I know that's not right but I'm not sure how else to approach (don't have much experience with javascript).
Thanks for any help.
MBaddar