I have a drop down button for selecting the gender (Male or female) and another drop down button for selecting marital status.
When selecting gender as male, then the marital status drop down button should list out:
- unmarried
- married
- divorced, and
- widower
When selecting gender as female the marital status drop down button should populate:
- unmarried
- married
- divorced, and
- widow
Based on the selection in the first drop down button, the contents of second drop down button should change.
Can anyone help me do this?
UPDATE:
add
id="gender"andonchange="updateMaritalStatus(this)"to the first selectkeep the second select option on one line
function for onload/onchange
add
onloadthe change the widow/widower