I have a multiple drop down list and I want to store the data into SQL Server Database when the user selects a particular option. The list is store in a JSON file and it is being displayed in the options in the drop down.
So if a person selects one drop down list the other list automatically displays a list based on the first one and so on. Upon clicking on submit button how can I store the selected values into a database.
Attaching a sample code for reference.
<table class="table">
<thead>
<th>
Interaction Reason 1
</th>
<th>
Interaction Reason 2
</th>
<th>
Interaction Reason 3
</th>
</thead>
<tbody>
<tr>
<td>
<select name="IR1" id="IR1" class="form-control input-sm">
<option value=""></option>
</select>
</td>
<td>
<select name="IR2" id="IR2" class="form-control input-sm">
<option value="">--Select Option--</option>
</select>
</td>
<td>
<select name="IR3" id="IR3" class="form-control input-sm">
<option value="">--Select Option--</option>
</select>
</td>
</tr>
</tbody>
</table>
<button type="button" name="sub" class="btn btn-default">submit</button>
[
{
"id":"1",
"name":"Request",
"parent_id":"0"
},
{
"id":"2",
"name":"Cancel",
"parent_id":"0"
},
{
"id":"3",
"name":"Refund",
"parent_id":"0"
},
{
"id":"4",
"name":"Address Change",
"parent_id":"1"
},
{
"id":"5",
"name":"Color Change",
"parent_id":"1"
},
{
"id":"6",
"name":"Customer wants to change product color",
"parent_id":"5"
},
{
"id":"7",
"name":"Cancel Order",
"parent_id":"2"
},
{
"id":"8",
"name":"Customer wants a new Product",
"parent_id":"7"
}]