I have a drop-down select menu that contains 10 departments (Department table) in my company. Each department is linkedo one of 5 branches (Branch table). When a user fills out a form and choses a department I want it to autopopulate a text input box with the appropriate branch.
This is the query I want run each time a department is chosen:
Select BranchName from Department where Department= The select box value.
Here is what I have so far. Please help with the
JS function:
<SELECT NAME="Directorate" onChange="GetBranch()">
<OPTION VALUE="Accounting">Accounting
<OPTION VALUE="MIS">MIS
<OPTION VALUE="Marketing">Marketing
etc....
</SELECT>
<input type="text" name="branch> <--This field is dynamically populated by the GetBranch()
JS function