I am adding employee with designation field in dropdown (say 'Employee'). When I try to edit the profile of employee in another page the designation should display the pre-selected dropdown value with remaining values below.(the selected designation is not displaying first. it is shown as normal dropdown)
I have tried selected="selected"
<select class="form-control edited" id="designation_edit" name="designation_edit" ng-model="designation_edit">
<option value="HR" selected="selected">HR Executive</option>
<option value="Manager">Manager</option>
<option value="Employee">Employee</option>
<option value="Admin">Admin</option>
</select>
I have two modal boxes in my page. One for "add employee" and another for edit profile. When I add an employee with designation value from drop-down as employee, this selected value should be displayed first in edit page 'designation' drop-down with remaining values in the dropdown.
But currently, it is showing as normal dropdown in edit profile page. I need to fetch the selected value from add page and display here.
Help me to come out with this in angularjs.
Is it correct to add the below line in ajax call
$('#designation_edit').attr("selected":"selected");
I have tried:
$('#designation_edit').append('Designation Manager Employee Admin');